Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why my test project doesn't appear on test explorer

I am using VS2012 (v110) I create a simple dll application with only 1 function and a test project to test the dll function. I set up both projects to be debug builds for win32 and tried Clean and Rebuild both projects but I don't see any test to be run on the test Explorer windows.

I also reference Dll project in the test project already.

Why isn't there anything shown in Test Explorer windows?

like image 869
Asp Asp Avatar asked May 05 '13 13:05

Asp Asp


People also ask

How do I enable test Explorer in Visual Studio?

If Test Explorer is not visible, choose Test on the Visual Studio menu, choose Windows, and then choose Test Explorer (or press Ctrl + E, T). As you run, write, and rerun your tests, the Test Explorer displays the results in a default grouping of Project, Namespace, and Class.

How do I run a test project in Visual Studio?

Use Test Explorer to run unit tests from Visual Studio or third-party unit test projects. You can also use Test Explorer to group tests into categories, filter the test list, and create, save, and run playlists of tests. You can debug tests and analyze test performance and code coverage.


2 Answers

Actually MSTest doesn't work with simple class library projects. You will have to create a unit test project and place your tests there.

If you use other testing frameworks like NUnit, then you can use plain class library. You can then use NUnit to run the tests outside VS, or use tools like ReSharper to run those tests inside VS

like image 60
Ron Sher Avatar answered Sep 30 '22 13:09

Ron Sher


It seems you have used some test frameworks other that MSTest. If you want to use Test Explorer for some other frameworks you should install its runner too. for instance NUnit needs to install its test adapter as and extension in VS.NET

see here for more.

like image 26
Mohammad Hamed Avatar answered Sep 30 '22 13:09

Mohammad Hamed