Search code examples
nunitresharper

Why does Resharper not pick up my NUnit tests?


I recently converted from MSTest to NUnit. I did this by

  • replacing all occurrences of [TestMethod] by [Test], [TestClass] by [Test], etc.
  • I also deleted the Microsoft.VisualStudio... reference and added the NUnit.framework nuget package.

Since I've done that, Resharper isn't showing the little testing icon next to the methods. And if I run the tests using Ctrl + U, R it shows the right count but doesn't actually run any of them.

Does anyone have any idea?

Edit: There must be something screwed up with my assembly because I created a new one just called Test.Web and created a simple class with just the [TestFixture] and Resharper recognized it instantly.


Solution

  • There was a problem with the assembly. I'm not sure what. But I created a new blank class library, installed NUnit, Should and Moq. Then copied my classes from the previous assembly into the new one and voilá, everything worked.