Simple How-To for NUnit in Visual Studio


What is Unit testing?

Unit testing is a method by which individual units of source code, sets of one or more computer program modules together with associated control data, usage procedures, and operating procedures, are tested to determine if they are fit for use. Intuitively, one can view a unit as the smallest testable part of an application. Let me take the example of the ‘Calculator’  for demonstrating the unit testing.


  • Windows 7 as OS
  • Microsoft Visual Studio 2010 as IDE
  • NUnit as Unit Testing Tool


  • Create a new Project with C# Class Library and save it (‘Calculator’ in my example).
  • Rename the class ‘Class1.cs‘ to ‘Operator.cs‘.
  • Add the NUnit frameworks into the ‘Solution Explorer‘ by context-clicking on the project name and then select ‘Add Reference’ menu item.
  • When the Add Reference dialog appears, click on ‘Browse‘ and navigate to C:\Program Files (x86)\NUnit…

View original post 331 more words


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s