Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nunit tests not discovered in c# solution

The following is the configuration of my development setup (not that much all of this is required; but i thought i would give this information anyway)

  • Visual Studio 2012 Update 4
  • Nunit 2.6.3
  • Nunit Test Adapter 1.1
  • Windows 7 Ultimate 64 bit

The solution that I am working on has a number of unit tests written in c# using Nunit. I am logged in as the Administrator. For some reason I cannot view the tests in the test explorer.

  1. Upon opening the solution the error message displayed by VS is "Unexpected error detected. Check the output pane for details"

  2. The output pane just mentions that there were 0 tests detected

  3. I have tried everything from re-installing Nunit, repairing VS, to resetting the IDE and the windows layout. No success.

  4. If i login as another user on my laptop, I am ABLE to view the tests in test explorer.

Given point no 4 above, can anyone help me to work my way backwards? Try to find out what the problem might be.

The only other painful option would be to reinstall VS. I dont want it to come to that.

Thanks in advance

like image 532
Nomad Avatar asked Aug 24 '14 13:08

Nomad


4 Answers

Make sure that the nunit test adapter is available in Tools | Extensions & updates. I had a similar problem because i installed the test adapter as part of a project, I had to explicitly add it in the extensions & updates too. I hope this is the same problem that you are having here.

Also check this post : Tests magically disappeared from Test Explorer pane in Visual Studio 2013

like image 169
Philip Stuyck Avatar answered Nov 12 '22 05:11

Philip Stuyck


One more thing, make sure the build checkbox is checked in Configuration Manager for your test project.

enter image description here

like image 35
kite Avatar answered Nov 12 '22 05:11

kite


You have to install NUnit3TestAdapter extension for visual studio ,and you can get it from visual studio marketplace. https://marketplace.visualstudio.com/items?itemName=NUnitDevelopers.NUnit3TestAdapter

like image 30
ravichandra vydhya Avatar answered Nov 12 '22 07:11

ravichandra vydhya


As Philip mentioned you have to also install Nunit Adapter in Tools >> Extensions and Updates and search online for Nunit test adapter and download it, then restart the Visual studio and it should discover all your test and now you can run it too. It worked for me.

like image 44
Vivek Avatar answered Nov 12 '22 06:11

Vivek