Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate existing NUnit tests to xUnit #9947

Open
vzarytovskii opened this issue Aug 15, 2020 · 4 comments
Open

Migrate existing NUnit tests to xUnit #9947

vzarytovskii opened this issue Aug 15, 2020 · 4 comments
Labels
Area-Testing Impact-Low (Internal MS Team use only) Describes an issue with limited impact on existing code.

Comments

@vzarytovskii
Copy link
Member

Migrate existing NUnit test suites (mostly UnitTest ones), to xUnit.

@sergey-tihon
Copy link
Contributor

@vzarytovskii can you please comment why? What is wrong with NUnit?

@vzarytovskii
Copy link
Member Author

@sergey-tihon

Nothing wrong with NUnit, since we've started migrating old fsharpqa and Cambridge suites to the new standard dotnet test suites, we've just chosen xUnit as default framework.

I guess, the main reason is it's already widely adopted in most of the exiting .NET projects (for example Roslyn, runtime, sdk, aspnetcore), so we want have same experience across all projects.

Also, I, personally find it a bit less verbose, than NUnit, and a bit easier to extend (but again, it is probably just my subjective take on it).

@vzarytovskii
Copy link
Member Author

@sergey-tihon Please, let me know if you would like to chat about it, i would gladly discuss it :)

@sergey-tihon
Copy link
Contributor

I am not strongly agains xUnit, just wonder why some .net project choose xUnit over NUnit and what benefits come with xUnit.

I personally less experienced with xUnit, but when I tried to port some of my projects to xUnit I stuck with inability execute Theory in parallel what is easy doable in NUnit

If you have samples where xUnit is less verbose and easier to extent on top of you mind, I will be glad to take a look.

@KevinRansom KevinRansom added the Impact-Low (Internal MS Team use only) Describes an issue with limited impact on existing code. label Jul 21, 2021
kant2002 added a commit to kant2002/fsharp that referenced this issue Jan 25, 2022
I hitting bunch of exceptions during execution of `dotnet test tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj` on Linux with only .NET 6 installed.
```
System.ArgumentException: Unknown framework version 6.5 (Parameter 'version')
   at NUnit.Framework.Internal.RuntimeFramework.ThrowInvalidFrameworkVersion(Version version)
   at NUnit.Framework.Internal.RuntimeFramework.InitFromFrameworkVersion(Version version)
   at NUnit.Framework.Internal.RuntimeFramework..ctor(RuntimeType runtime, Version version)
   at NUnit.Framework.Internal.RuntimeFramework.<>c.<.cctor>b__33_0()
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.get_Value()
   at NUnit.Framework.Internal.RuntimeFramework.get_CurrentFramework()
   at NUnit.Framework.Internal.PlatformHelper..ctor()
   at NUnit.Framework.TestCaseAttribute.BuildFrom(IMethodInfo method, Test suite)+MoveNext()
   at NUnit.Framework.Internal.Builders.DefaultTestCaseBuilder.BuildFrom(IMethodInfo method, Test parentSuite)
   at NUnit.Framework.Internal.Builders.NUnitTestFixtureBuilder.AddTestCasesToFixture(TestFixture fixture, IPreFilter filter)
   at NUnit.Framework.Internal.Builders.NUnitTestFixtureBuilder.BuildFrom(ITypeInfo typeInfo, IPreFilter filter)
   at NUnit.Framework.Internal.Builders.DefaultSuiteBuilder.BuildFrom(ITypeInfo typeInfo, IPreFilter filter)
```

In spirit of dotnet#9947 maybe would be better to migrate these tests to XUnit
KevinRansom pushed a commit that referenced this issue Jan 26, 2022
I hitting bunch of exceptions during execution of `dotnet test tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj` on Linux with only .NET 6 installed.
```
System.ArgumentException: Unknown framework version 6.5 (Parameter 'version')
   at NUnit.Framework.Internal.RuntimeFramework.ThrowInvalidFrameworkVersion(Version version)
   at NUnit.Framework.Internal.RuntimeFramework.InitFromFrameworkVersion(Version version)
   at NUnit.Framework.Internal.RuntimeFramework..ctor(RuntimeType runtime, Version version)
   at NUnit.Framework.Internal.RuntimeFramework.<>c.<.cctor>b__33_0()
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.get_Value()
   at NUnit.Framework.Internal.RuntimeFramework.get_CurrentFramework()
   at NUnit.Framework.Internal.PlatformHelper..ctor()
   at NUnit.Framework.TestCaseAttribute.BuildFrom(IMethodInfo method, Test suite)+MoveNext()
   at NUnit.Framework.Internal.Builders.DefaultTestCaseBuilder.BuildFrom(IMethodInfo method, Test parentSuite)
   at NUnit.Framework.Internal.Builders.NUnitTestFixtureBuilder.AddTestCasesToFixture(TestFixture fixture, IPreFilter filter)
   at NUnit.Framework.Internal.Builders.NUnitTestFixtureBuilder.BuildFrom(ITypeInfo typeInfo, IPreFilter filter)
   at NUnit.Framework.Internal.Builders.DefaultSuiteBuilder.BuildFrom(ITypeInfo typeInfo, IPreFilter filter)
```

In spirit of #9947 maybe would be better to migrate these tests to XUnit
@vzarytovskii vzarytovskii moved this to Not Planned in F# Compiler and Tooling Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Testing Impact-Low (Internal MS Team use only) Describes an issue with limited impact on existing code.
Projects
Status: New
Development

No branches or pull requests

4 participants