- NUnit
-
NUnit
NUnit 2.4.6 GUI on WindowsStable release 2.5.10 / April 2, 2011 Written in C# Operating system Microsoft .NET, Mono Type Unit testing tool License BSD-style (modified zlib license) Website nunit.org 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.
Contents
Features
Every test can be added to one or more categories, to allow running them selectively.[1]
Example
Example of an NUnit test fixture:
using NUnit.Framework; [TestFixture] public class ExampleTestOfNUnit { [Test] 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 // [http://www.nunit.org/index.php?p=constraintModel&r=2.4.7]: Assert.That(2*2, Is.EqualTo(4), "Multiplication constraint-based"); } }
The NUnit framework discovers the method
ExampleTestOfNUnit.TestMultiplication()
automatically by reflection.Extensions
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
References
- ^ "CategoryAttribute - NUnit documentation". http://nunit.org/index.php?p=category&r=2.4.7. Retrieved 2008-04-15.
- ^ "Firebenchmarks website main page". http://www.firebenchmarks.com/.
- ^ "NUnit.ASP website main page". Sourceforge. http://nunitasp.sourceforge.net/. Retrieved 2008-04-15.
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
- Official website
- Launchpad Site
- Test-driven Development with NUnit & Test-driven.NET video demonstration
- FireBenchmarks home page
- NUnit.Forms home page
- NUnitAsp homepage
- Article Improving Application Quality Using Test-Driven Development provides an introduction to TDD with concrete examples using Nunit
Categories:- Extreme Programming
- Unit testing frameworks
- Free software programmed in .NET
Wikimedia Foundation. 2010.