vendredi 26 février 2021

What version of NUnit 3 should I be using

I have successfully converted a testing solution from .NET 4.6.1 to .NET Core 3.1. Within the solution I reference NUnit.Console 3.12.0, NUnit.ConsoleRunner 3.12.0, NUnit.Engine 3.12.0, and NUnit3TestAdapter 3.17.0. All the latest stable bits. When running the tests within Visual Studio, all is well.

My challenge is when I use .\.nuget\packages\nunit.consolerunner\3.12.0\tools\nunit3-console.exe <reference to my .NET Core 3.1 test csproj> to execute the tests. I am getting an exception that is discribed here: The NUnit 3 driver encountered an error while executing reflected code (NUnit.Engine.NUnitEngineException). According to http://charliepoole.org/technical/nunit-engine-version-conflicts-in-visual-studio.html I should be paying attention to the versions of NUnit. I have changed my NUnit references to NUnit.Console 3.11.1, NUnit.ConsoleRunner 3.11.1, NUnit.Engine 3.11.1, and NUnit3TestAdapter 3.17.0. When using .\.nuget\packages\nunit.consolerunner\3.11.1\tools\nunit3-console.exe <reference to my .NET Core 3.1 test csproj> I am still getting the exception listed earlier. I changed my csproj version to be netstandard2.0 to see what happens; no luck getting NUnit executable to successfully run.

I did obtain the zipped folder of the NUnit solution. When using .\.nunit-console-3.12\bin\Debug\netcoreapp3.1\nunit3-console.exe <reference to my .NET Core 3.1 test csproj> no problems - all is well. So obviously I am doing something incorrectly since locally compile version works but NuGet version does not.

I need to use the NuGet installed version since that is what the build server will use to execute the tests. Ideas and/or suggestions on what I am doing incorrectly?

Aucun commentaire:

Enregistrer un commentaire