My platform: Visual C# 2008 Express Edition with NUnit 2.2.7
I have a solution with my code in one project and my NUnit unit tests in a different project in the same solution.
I have been struggling hard to debug and single-step through the NUnit tests. I found some references online that suggested calling the following:
NUnit.ConsoleRunner.Runner.Main(args);
But this doesn't even compile - it has the compiler error:
Error 1 The type or namespace name 'Runner' does not exist in the namespace 'NUnit.ConsoleRunner' (are you missing an assembly reference?)
I've added every assembly reference I could find, to no effect.
Finally, this is what I have hacked together and it works, but perhaps you good readers could suggest a better solution:
1) In my test project, the class name of a test case that I want to debug is MyTestClass. It has a [TestFixtureSetUp] method named Init() and the actual test case is in [Test] function MyTest()
2) In my code project, I have a console program TestProgram.cs which compiles to an EXE.
In TestProgram.cs, I call the test cases in the following way
// First instantiate the test class
MyTestClass tc = new MyTestClass();
// Call the TestFixtureSetup method
tc.Init();
// Now call the actual test
tc.MyTest();
This works and I can debug and single step through the test cases.
If anyone has any better suggestions using Visual Studio 2008 Express without paying for additional plugins, I appreciate your advice.