Reputation: 2244
I have created a unit test project in VS2013, and I'm using it to create a test suite for my SQL Server 2012 database.
I have created 4 test classes so far and everything worked fine. When I created the 5th - magic! All tests disappear from the test explorer window.
I tried rebuilding the project - didn't work. Rebuilt the database project too; didn't work. Created a new unit testing project with a single unit test inside it - doesn't work.
Has this happened to anyone? Does anyone know what to do? Please help!
Upvotes: 15
Views: 12918
Reputation: 190
I had a similar problem, the test appeared again after deleting the hidden .vs folder in the project build folder and then restarting visual studio.
Upvotes: 2
Reputation: 29
Late to the party, but make sure you have the chemical bottle icon selected. If there's a failure it may have defaulted to failures (the X) icon selected in the test explorer window. Gets me every time.
Upvotes: 2
Reputation: 1355
Visual Studio Test Explorer has icons that control what tests are shown, make sure what you want to see is selected. For example, if you unselect the green checkbox, tests will disappear as they pass.
Upvotes: 13
Reputation: 3363
I just had the exact same thing happen to be. Build, Rebuild, Clean Build, the Test Explorer couldn't list for me my unit tests!
This came after I changed the unit test project's platform target from "any CPU" to x64. I switched it back to "any CPU", built, and they appeared again. How frustrating.
Upvotes: 1
Reputation: 19765
I just had this very same problem and for me the solution was to go to Tools -> Extensions and updates, uninstall NuGet package installer for 2013 and re-install it.
Upvotes: -1
Reputation: 3305
Are you using nUnit? I've just had a similar situation moving to a new pc, causing all existing tests to disappear.
Go to Tools -> Extensions and updates -> Select Online on the left -> enter in the search box top right 'nunit test adapter' and install it.
One rebuild later and the tests appeared again.
Upvotes: 10