Pages

Showing posts with label .Net Testing. Show all posts
Showing posts with label .Net Testing. Show all posts

Monday, December 29, 2008

NUnit

NUnit is an automated unit testing framework for .NET

NUnit is free to use with your .NET projects.

NUnit is ported from another product called JUnit, which is a unit testing framework for Java applications.

NUnit provides a class library which includes some classes and methods to help you write test scripts.

NUnit provides graphical user interface application to execute all the test scripts and show the result as a success/failure report (instead of message boxes from the test script).

NUnit is the most popular unit testing framework for .net applications.

NUnit does not create any test scripts by itself. You have to write test scripts by yourself, but NUnit allows you to use it's tools and classes to make the unit testing easier.

NUnit is an open source product. You can get this tool along with source code and modify the source code if required for your specific needs. However, 99% of the programmers do not mess with the source code. Instead, you can download only the executable and class library and implement unit test scripts for your application.

Now Microsoft offers a team collaboration system called 'Visual Studio Team System' (VSTS). This tool includes a unit testing framework also. So, eventually most of the developers may switch to VSTS instead of NUnit. However, NUnit will continue to exist because it is free and easy to use.

Monday, February 4, 2008

NUnit

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.

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;
using NUnit.Framework.SyntaxHelpers;

[TestFixture]
public class TestOfNUnit
{
[Test]
public void TestMultiplication()
{
Assert.AreEqual(4, 2*2, "Multiplication");

// Equivalently, NUnit offers a new (in v2.4)
// and more intuitive constraint-based assertion syntax:
Assert.That(4, Is.EqualTo(2*2), "Multiplication constraint-based");
}
}

For more information check out the below link
http://www.nunit.com/index.php