NUnit
From Free net encyclopedia
NUnit is an open source unit testing framework for Microsoft .NET. It serves the same purpose as JUnit does in the Java world.
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.
NUnit.ASP 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 ASP.NET.
Example of an NUnit test fixture:
using NUnit.Framework; [TestFixture] public class WikipediaExampleOfNUnit { [Test] public void TestMultiplication() { Assert.AreEqual(4, 2*2, "Multiplication"); } }
The NUnit framework discovers the method HelloWorld.TestMultiplication()
automatically by reflection.
[edit]
See also
[edit]
Literature
- Andrew Hunt, David Thomas: Pragmatic Unit Testing in C# with NUnit. The Pragmatic Bookshelf, Raleigh 2004, ISBN 0-9745140-2-0
- 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
[edit]
External links
- SourceForge Site
- NUnit homepage
- NUnit.Forms homepage
- NUnitAsp homepage
- Article Improving Application Quality Using Test-Driven Development provides an introduction to TDD with concrete examples using Nunit