4

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?

Community
  • 1
  • 1
Sealer_05
  • 5,346
  • 8
  • 35
  • 53

1 Answers1

3

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?

Alexander Groß
  • 10,200
  • 1
  • 30
  • 33
  • Thank You for your response. When I go to pluggins in resharper the only one I see is NuGet support for ReSharper. If I go to the nuget manager and search for machine specifications it shows that it is installed though. Also when I go to Resharper Options > Tools > Unit Testing I do not see anything related to MSpec but Unit testing is enabled. – Sealer_05 Feb 15 '14 at 15:45
  • Also I should note that I have been installing using PM> Install-Package Machine.Specifications and it looks like it has been installing successfully. The files are in the packages directory and if I run mspec.exe from cmd prompt it prompts for options/assembly – Sealer_05 Feb 15 '14 at 16:34
  • 3
    You need the mspec plug-in for ReSharper. There should be batch files for installation in the tools folder of the nuget package. – Alexander Groß Feb 18 '14 at 18:44
  • 1
    That was it! To be exact it was the batch file called InstallResharperRunner. Thank you so much! – Sealer_05 Feb 19 '14 at 02:02