How do I get past the "No tests found in file" error in MSpec when everything is written correctly?

StackOverflow https://stackoverflow.com/questions/21791830

Question

I have tried these two tutorials and a project of my own with MSpec but I am getting the error "No tests found in file" every time. I have also looked at this SO solution. And I made sure my classes are public.

I would post code but I literally have tried copying and pasting the exact code in the above links with no luck. VS2012/Resharper 8.1/Mspec added via NuGet. Two libraries, one with the class to be tested and the other with the tests.

What am I doing wrong?

Was it helpful?

Solution

Please make sure that ReSharper loads the MSpec plugin successfully. You can see loaded plugins in ReSharper/Options/General/Plugins.

Also make sure that the MSpec unit test provider is enabled. Its in the options dialog, at the bottom of the tree to the left.

Your contexts don't need to be public to be detected. A class with an It field is all that is required for the plugin to detect tests.

If that doesn't work, please try to run your spec assembly with mspec.exe (command line runner) - does it execute specs correctly?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top