NUnit GUI.png
NUnit 2.4.6 GUI on Windows
Stable release 2.5.10 / April 2, 2011; 7 months ago (2011-04-02)
Written in C#
Operating system Microsoft .NET, Mono
Type Unit testing tool
License BSD-style (modified zlib license)

NUnit is an open source unit testing framework for Microsoft .NET. It serves the same purpose as JUnit does in the Java world, and is one of many in the xUnit family.



Every test can be added to one or more categories, to allow running them selectively.[1]


Example of an NUnit test fixture:

using NUnit.Framework;
 public class ExampleTestOfNUnit
   public void TestMultiplication()
     Assert.AreEqual(4, 2*2, "Multiplication");
     // Equivalently, since version 2.4 NUnit offers a new and
     // more intuitive assertion syntax based on constraint objects
     // []:
     Assert.That(2*2, Is.EqualTo(4), "Multiplication constraint-based");

The NUnit framework discovers the method ExampleTestOfNUnit.TestMultiplication() automatically by reflection.


FireBenchmarks[2] is an addin able to record execution time of unit tests and generate XML, CSV, XHTML performances reports with charts and history tracking. Its main purpose is to enable a developer or a team that work with an agile methodology to integrate performance metrics and analysis into the unit testing environment, to easily control and monitor the evolution of a software system in terms of algorithmic complexity and system resources load.

NUnit.Forms is an expansion to the core NUnit framework and is also open source. It specifically looks at expanding NUnit to be able to handle testing user interface elements in Windows Forms. As of August 2010, Nunit.Forms is in Alpha release, and no versions have been released since May 2006.

NUnit.ASP is a discontinued[3] expansion to the core NUnit framework and is also open source. It specifically looks at expanding NUnit to be able to handle testing user interface elements in ASP.NET.

See also


Further reading

  • Andrew Hunt, David Thomas: Pragmatic Unit Testing in C# with NUnit, 2nd Ed. The Pragmatic Bookshelf, Raleigh 2007, ISBN 0-9776166-7-3
  • Jim Newkirk, Alexei Vorontsov: Test-Driven Development in Microsoft .NET. Microsoft Press, Redmond 2004, ISBN 0-7356-1948-4
  • Bill Hamilton: NUnit Pocket Reference. O'Reilly, Cambridge 2004, ISBN 0-596-00739-6

External links

Wikimedia Foundation. 2010.

Look at other dictionaries:

  • NUnit — Графическая среда NUnit 2.4.6 под Windows Тип Система автоматизированного тестирования …   Википедия

  • NUnit — es un framework open source de Pruebas de unidad para Microsoft .NET y Mono. Sirve al mismo propósito que JUnit realiza en el mundo Java, y es uno de muchos en la familia xUnit. NUnit.Forms es una expansión al framework núcleo NUnit y es también… …   Wikipedia Español

  • NUnit — Aktuelle Version (2. April 2011) Programmier­sprache .NET Lizenz zlib Lizenz …   Deutsch Wikipedia

  • Nunit — …   Википедия

  • Fortran language features — This is a comprehensive overview of features of the Fortran 95 language, the version supported by almost all existing Fortran compilers. Old features that have been superseded by new ones are not described few of those historic features are used… …   Wikipedia

  • NUnitAsp — is a tool for automatically testing ASP.NET web pages. It s an extension to NUnit, a tool for test driven development in .NET. Contents 1 How It Works 2 Credits History 3 See also 4 External links …   Wikipedia

  • Test-driven development — (TDD ) is a software development technique consisting of short iterations where new test cases covering the desired improvement or new functionality are written first, then the production code necessary to pass the tests is implemented, and… …   Wikipedia

  • ThoughtWorks — Infobox Company company name = ThoughtWorks Inc. company type = Private foundation = 1993 company key people = Neville Roy Singham, Chairman Trevor Mather, CEO Graham Webster, CFO Martin Fowler, Chief Scientist industry = IT Consulting Management …   Wikipedia

  • Dave Thomas (programmer) — This page is about Dave (David) Thomas, the computer programmer and author/editor, and not about Dave Thomas, founder of IBM OTI Labs. For other people named Dave or David Thomas, see David Thomas. Dave Thomas speaking at the Pasadena Rails… …   Wikipedia

  • Andy Hunt (author) — Andy Hunt (sometimes credited as Andrew Hunt) is a writer of books on software development. Hunt co authored The Pragmatic Programmer , six other books and many articles,and was one of the 17 original authors of the Agile Manifesto and founders… …   Wikipedia