Like in older versions of Visual Studio it is possible to use NUnit as an external tool in the new 2010 version. By creating a toolbar as well it is very easy to run your test suite. The usual way to add an external command is by clicking the menu Tools -> External Tools. However, by default this menu item is not visible. To enable this menu item go to Tools -> Settings -> Expert Settings.
In some of my web applications I use Rhino Mocks to create mock objects. Usually the code has a record section where the expected calls are recorded, and a playback section where the testing is done. In the following code snippet the DoSomething() function calls a void function which is defined in the interface of _myMock. The problem is this void function is not expected and the NUnit test run will fail:
Rhino.Mocks.Exceptions.ExpectationViolationException : IMyInterface.MyVoidFunction; Expected #0, Actual #1.
/* insert expectation for void function here */
// DoSomething calls the mocked object's GetValue function, which returns 'b' when the parameter is 'a'
// DoSomething also calls a void function which is located in the interface of the mocked object, so this
// void function must be mocked too, else the test run will fail