Visual Studio and NUnit GUI

In order to use NUnit with Visual Studio you do not need to install or configure NUnit into Visual Studio.  You will simply load .DLLs or .EXEs into NUnit through it's GUI.

Before creating any projects add the NUnit Test Adapter to Visual Studio

  1. Select Tools/Extensions and Updates
  2. Select online
  3. Search for NUnit, download and install

Install NUnit onto your machine.  When you create a project and want it to be used by NUnit, you must ensure that the libraries are available to your project.  

  1. Select Project/Add Reference
  2. Select Extensions
  3. Search for nunit.Framework and nunit.Mocks
    1. if they are not available, select Browse... in the lower right of the open dialog
    2. navigate to the directory where you installed NUnit
    3. add the nunit.framework.dll to the list of extensions
  4. Add them to your project

Step-by-step guide 

  1. Add the following using statement - using NUnit.Framework
  2. Add [TestFixture] attribute to your class
  3. If you need to initialise objects that you want to reuse across multiple tests add a setup method, this is done by adding the [Setup] attribute
  4. For each operation that you need to indicate is a test method mark it with the [Test, Category("...")], Category is optional