A post on the TDD list asks about running NUnit tests using the Start button in Visual C# Express. In Visual Studio 2003 and 2005, you can set up a project’s Debug properties so that an arbitrary external program is executed. By selecting NUnit as that program and providing the correct command-line options, you can cause your tests to be run.
But in Visual C# 2005 Express, the only choice you have is to execute one of your own programs, with the result that this approach to running tests is unavailable. Of course, you could always run NUnit separately, as many of us do. Or you could set it up as an external tool using the Tools | External Tools… menu item, which works the same in the Express version as in the others.
But if you’re really attached to the approach using the Start button, all is not lost. You merely need a project of your own that runs the tests under NUnit. This is much easier than you might imagine. Just create an Windows executable and add a reference the nunit-gui-runner assembly. Replace the contents of Main() with a call to AppEntry.Main() with the same arguments you were passed. Here’s what it looks like…
static class Program
/// The main entry point for the application.
static void Main(string args)
Make this project your startup project and set the commandline to point to the output of the project containing your tests. Use the /run option and any other options you like. When executed, this program will launch the NUnit GUI and run your tests.