NUNIT - Testing your Application NUnit Tool – Used for Test driven development • Lets create a sample banking class named account which supports operations to deposit, withdraw or transfer funds. • To get started, lets create a new project, and select project type as Visual C# - Class Library • Also give the location as C:\Documents and Settings\smktb\My Documents\Visual Studio 2005\Projects -- with your respective username and give the name to the Class Library as TestNUnit New Class Library Rename the class name to Account.cs from Class1.cs Add NUnit Reference by selecting your project name, right click and add reference as shown below Add a new class “TestAccount.cs” and add the below code. Also add the namespace “using NUnit.Framework” and then build the solution Start NUnit GUI from Programs-Applications-NUnit-Net-2.0 – NUnit GUI. Click on File-Open-Select the folder where your program is stored, go to the bin directory and select TestNUnit.dll Click on Run to check the output. In this case, the test case will fail, as we did not invoke destination.Deposit(amount). In order to correct the error, lets uncomment the line in Account.cs file which says “destination.Deposit(amount)”. Important points to note is that [TestFxture] denotes that the corresponding class contains a “Test Case” and [Test] indicates that the corresponding function is a test case