NUnit installation and NUnit Installation
What is NUnit?
NUnit is a unit test framework specifically for. NET. NUnit is the 4th main product in the xUnit family. It is fully written in the C # language and fully utilizes many. NET features, such as reflection and customer attributes. The most important thing is that it is suitable for all. NET languages.
I. NUnit Installation
1. Download NUnit (NUnit-2.6.4.msi), double-click to install until complete.
It is worth noting that if we want to write the test class, we need to reference nunit. framework
2. view the test result (we recommend that you install the plug-in)
Generally, we want to see the results after running the test. There are three methods:
1. NUnit GUI
This is the client after NUnit is installed. The figure shows its interface. we load the dll or assembly of the program to run the test class and view the test results and results.
2. NUnit command line
It is related to the test using shell (graphical shell). Here we need to set the environment variable (add the NUnit installation Path C: \ ProgramFiles (x86) in the Path) \ NUnit 2.6.4 \ bin)
3. Nunit Test Adapter plug-in of Visual Studio (this is the integration of VS and NUnit)
In fact, I prefer this one. I don't need to open two windows every time like the first two. Instead, we only need to install a NUnit plug-in, you can directly execute the test in VS and see the test result ,.
Plug-in installation: In the VS toolbar → tools → extensions and updates (U) → In the pop-up box, select "online" on the left ", enter the keyword "nunit" in the search box, locate "Nunit Test Adapter", and click Install.