NUnit is an open-source unit-testing framework for any .NET language.

WiseTech-NUnit3-Primer.pdf

Background:

A project using NUnit has several components:

NUnit:

In NUnit, there are 2 main constructs: test fixtures and test methods.

using NUnit.Framework;

**[TestFixture]**
public class ClassTests {
		**[Test]**
		public void **MethodName_Scenario_ExpectedBehaviour**() {
				// Arrange
				// Act
				// Assert
		}
}

Assertions:

NUnit provides an Assert class and other helper classes like Has, Is, etc. that encourage you to write constraint model tests.

// Typical format:
Assert.That(value, constraint);

// Examples:
Assert.That(2, Is.GreaterThan(0));

// A failure message can be given as the third argument
Assert.That(
	int.MaxValue + 100, 
	Is.GreaterThan(0),
	"This should be a really big positive number" 
);

Parameterised Tests:

NUnit provides the [TestCase] attribute which lets you pass parameters to a test method.