C# – Visual Studio Unit Tests Not Found

cnunitunit testingvisual studiovisual studio 2010

I am using Visual Studio for a C# application.

In my PC i had installed Gallio, which is a set of test tools (including a test runner). My Unit tests are normal unit tests using the NUnit framework. At my PC, Visual Studio can identify and run the tests.

But when i change PCs, or when i un-installed Gallio from mine, Visual Studio cannot longer find the unit tests giving a message as below:

"No Tests were run because no tests were loaded or the selected tests are disabled"

I know that the fact that my projects cannot be loaded, is because of Gallio. When i was adding a Test class in my project the Test Type was set to Gallio. I tried almost everything to make Visual Studio being able to find my test classes again but without any luck.

Does anyone have the same problem? Any ideas why this is happening?

Thank you.

Best Answer

Visual Studio 2010 doesn't have a test runner for NUnit. It can only execute MSUnit tests by default without using an add-on like Resharper. Visual Studio 2012 does now include a runner for NUnit among other testing frameworks.

You have the following options:

  1. Port your tests to use MSUnit; or
  2. Upgrade to Visual Studio 2012; or
  3. Install an add-on like Resharper that has a NUnit runner built in.