marthijn. Rotating Header Image

Using NUnit in Visual Studio 2010

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.

Visual Studio 2010

The first step is download and install the latest version of NUnit since older versions are not compatible with .NET 4. NUnit version 2.5.5 can be downloaded here.

Now go to Tools -> External Tools:

Visual Studio 2010 External Tools

I think this screen shot explains itself very well. Now its possible to add this external command to a tool bar. To do so go to View -> Toolbars -> Customize:

Visual Studio 2010 Customize Toolbars

Press the New button and enter a name. Now open the Commands tab and add the external command (usually External Command 1 when you don’t have any other external commands) to the toolbar:

Visual Studio 2010 Toolbars

When clicking the NUnit button in the new toolbar the NUnit GUI starts and loads your test suite.


Related posts:

  1. Using Rhino Mocks to mock a void function
  2. Using log4net to show NHibernate SQL in Visual Studio
  3. Possible solution for NHibernate many-to-many criteria
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

8 Comments

  1. Wole says:

    Very helpful. Many thanks

  2. Andre says:

    first update NUnit for .NET 4.0 or else its useless…

  3. Erik says:

    Works like a charm. Thanks for this tip.

  4. Martin says:

    Many thanks for posting this, Marthijn.

  5. juanp says:

    Great tip. I will clarify that last step about selecting the “External Command [x]” . The [x] corresponds to entry number of “Nunit tools” in the “External Tools” window. For example if Nunit tools is the third entry in the list, then you would select “External Command 3″

  6. Ortins says:

    Thanks man !!! You help me a lot !

  7. Steve says:

    Great article! Well done.

  8. CoolSpark says:

    Thanks a lot man. This is very helpful

Leave a Reply