Some things I've noticed I have to do from time to time to get tests to show up properly.
If your solution is in a protected drive that you need administrator access to read/write, sometimes only a portion of the tests come up. Definitely run VS as administrator in that case.
If your solution is 64 bit, make sure that Test > Test Settings > Default Processor Architecture is set to x64. Sometimes it gets set to x86. Set it to x64, then rebuild.
Sometimes just restarting Visual Studio does the trick because the test explorer will start up again.
Don't forget to actually build the test project/solution. (If you want it to get built with the rest of the projects, right-click on your solution > Properties > Configuration Properties > Configuration > check the "Build" box for your test project)
Ensure the tests are in a
public
section of your test class
https://stackoverflow.com/questions/25304425/visual-studio-2013-doesnt-discover-unit-tests
How to install NUnit Test Adapter
http://nunit.org/nunitv2/docs/2.6.4/vsTestAdapter.html
NUnit Test Adapter for Visual Studio
Installation
Beginning with version 0.95 there are two ways of installing the adapter within Visual Studio. See Note 1 below for info on how to choose.
- Use the Extension Manager
- Add it as a Nuget package to your solution. (New in 0.95, requires VS 2012 Update 1 or higher)
Installing With the Extension Manager
To install the NUnit Test Adapter using the Extension Manager, follow these steps:
- From within Visual Studio 2012, 2013 or 2015, select Tools | Extension Manager.
- In the left panel of the Extension Manager, select Online Extensions.
- Locate (search for) the NUnit Test Adapter in the center panel and highlight it.
- Click 'Download' and follow the instructions.
Use the Extension Manager to ensure that the NUnit Test Adapter is enabled.
Installing the Nuget Package
To add it is a Nuget package, you must have an active solution, then follow these steps:
- From Tools menu, use Library Package Manager, select Manage NuGet packages for solution
- In the left panel, select Online
- Locate (search for) NUnit Test Adapter in the center panel and highlight it
- You will find two packages, one without framework and one with framework. See note 2 below for which to choose.
- Click 'Install'
- In the "Select Projects" dialog, you need to select at least one project to add the adapter to, see notes below.
No comments:
Post a Comment