Unit testing using NUnit in Visual Studio 2010 - Online Free Computer Tutorials.

'Software Development, Games Development, Mobile Development, iOS Development, Android Development, Window Phone Development. Dot Net, Window Services,WCF Services, Web Services, MVC, MySQL, SQL Server and Oracle Tutorials, Articles and their Resources

Wednesday, July 11, 2018

Unit testing using NUnit in Visual Studio 2010

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. SOFTWARE REQUIREMENTS: Windows 7 as OS Microsoft Visual Studio 2010 as IDE NUnit as Unit Testing Tool SET-UP INSTRUCTIONS: 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 2.5.10\bin\net-2.0\framework and select nunit.framework.dll. Finally, the solution Explorer should look like this: Create and writing scenarios for Unit tests: Create scenarios for testing the operators such as Add, Subtract, Multiply, Divide, Square Root and Reciprocal.


I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.


This article is related to

C#,Unit Testing,Visual Studio

No comments:

Post a Comment