NUnit Setup In Visual Studio And Example NUnit test case

Once installed, Within Visual Studio, Tools | Nunitit | NUnitit settings

Change NUnit-GUI Executable to install path: C:\Program Files\NUnit 2.5.5\bin\net-2.0\nunit.exe

When you want to run an NUnit test, set the NUnit project in VS.NET as startup project and navigate to Tools | Debug Nunit GUI. The Nunit test interface will then load.

From there you can execute your test cases.

Very simple example of NUnit test:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;

    public class TestJHAServiceManager
        public void GetJHANames()
            List<string> strings = JHAServiceManager.GetJHANames("jUnit");

        /// <summary>
        /// Gets the JHA details with invalid id.
        /// Another example where an exception is expected
        /// </summary>
        public void GetJHADetailsWithInvalidId()
            JobHazardAnalysis jha = new JobHazardAnalysis()
                Id = -25