

We can change the data on the fly in the data file and every time the test method will be executed with different set of data. Now observe the TestSumCsvFile(int num) method with integer array as parameter and it executes for as many number of records in the csv file. I have yet again used a List and converted it to array in order to keep array length as flexible. Public string Concat(string str1, string str2) I have added a class library to the solution which has some methods for which we will write NUnit tests. Let us start from scratch by creating an empty solution in VS 2015. I am now going to walk you through the process of installation and use of Nunit framework. NUnit can be incorporated in Visual Studio by installing NuGet packages of NUnit. It is similar to Junit which is used for Java. NUnit is a unit testing framework which can be used for. Unit Tests are written by the same developers who are writing that unit of code. Visual Studio provides support for unit testing via the MS Test framework as well as third party frameworks like NUnit. Unit Testing is typically an automated functionality testing. Unit Testing in simple words is a testing process in which a unit of code is tested. I have briefly mentioned NUnit test with Visual Studio in one of my previous articles ( Code Quality Tools in Visual Studio 2015). I will also show you how easy it is to compute the code coverage in Visual Studio 2015. This article will describe all aspects of NUnit starting from Test Driven Development (TDD) to converting it to data driven test.
