I've just installed VS 2017. I have a project using NUnit for the test cases. Ctrl+R-T no longer runs the tests, and the Test Explorer no longer finds any test cases marked with the TestCase attribute.
Is there a way to get NUnit running yet, or an update I could find? I re-installed NUnit from the Nuget Package Manager to the latest version with no improvement.
You need to install NUnitTestAdapter. The latest version of NUnit is 3.x.y (3.6.1) and you should install NUnit3TestAdapter along with NUnit 3.x.y
To install NUnit3TestAdapter in Visual Studio 2017, follow the steps below:
Add the NUnit test adapter NuGet package to your test projects
Or install the Test Adapter visual studio extension. There is one for
I prefer the NuGet package because it will be in sync with the NUnit version used by your project and will thus automatically match the version used in any build server.
This one helped me: https://www.infragistics.com/community/blogs/dhananjay_kumar/archive/2015/07/27/getting-started-with-net-unit-testing-using-nunit.aspx
Basically:
My example code is here:
This will return true, if you change the Parameter in Is.EqualTo it will fail, etc.
To run or debug test in visual Studio 2017, we need to install "NUnit3TestAdapter". We can install it in any VS, but it is working properly in VS "community" version. To install this you can add through Nuget Package.
You need to install 3 NuGet packages:
Nunit
NUnit3TestAdapter
Microsoft.NET.Test.Sdk
Have fun writing unit tests!
You have to choose the processor architecture of Unit-Tests in VS:
Test > Test Settings > Default processor architecture
Test Adapter has to be open to see the tests: (VisualStudio e.g.:
Test->Windows->Test Explorer
Additional information whats going on you can consider at 'VS-Output-Window' and choose Drop-Down 'Show output from' and set 'Tests'