Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

0 Total Tests - 0 passed,0 failed ,0 skipped even after having tests in the class

While running unit test in Visual studio , i was getting 0 Total Tests - 0 passed,0 failed ,0 skipped even after having tests in the class.

like image 308
Bijay Nandagiri Avatar asked Sep 05 '20 13:09

Bijay Nandagiri


People also ask

How do I stop a test case from running in Visual Studio?

You need to close the Test Explorer Window to prevent automatic running.

Which is better NUnit or xUnit?

Both frameworks are awesome, and they both support parallel test running (in a different way though). NUnit has been around since 2002, it's widely used, well documented and has a large community, whereas xUnit.net is more modern, more TDD adherent, more extensible, and also trending in . NET Core development.

What is xUnit runner?

xunit.runner.devices. This package contains the devices runner. This runner can execute tests on physical and virtualized devices (iOS and Android via Xamarin, and UWP) from xUnit.net v2. To run UWP projects from within Visual Studio, please reference xunit.


3 Answers

In Nunit, if there is an exception in loading test setup or execution it will result in above. From Visual studio menu open debug=>output and select Test window and see are there any exceptions thrown when tests are run. In my case in project1 i have nunit2 (refernce), in project2 i have nunit3 which referred project1 which is causing conflict and unable to execute.

if you resolve the exception it should work

like image 85
Ajay Kopperla Avatar answered Oct 23 '22 05:10

Ajay Kopperla


Check if you have runsettings file in your solution or if there is one selected under VS -> Test -> Configure Run Settings. If this is chosen, uncheck it. Remove the file. This fixed for me.

like image 33
Indu Aravind Avatar answered Oct 23 '22 04:10

Indu Aravind


In Case anyone is still struggling with this, installing "MSTest.TestAdapter" solved my issue.

like image 28
Crime Master Gogo Avatar answered Oct 23 '22 05:10

Crime Master Gogo