Apply NUnit software for .NET program test initial

xiaoxiao2021-03-06  44

In the .NET environment, there are many software that can be done, and NUNIT is one of them. This is a unit test software that is known as JUnit, which belongs to the XUnit family. You can get this software for free at http://www.nunit.org. The NUnit application provides a framework for writing unit tests, as well as a graphical interface running these tests and viewing results.

What is said here is a problem that I will encounter in the first time. After installing NUNIT, its document will also be installed together to the local hard drive. Try to use the NUNIT to make a unit test according to its documentation, you need to add a reference Using NUnit.framework; the test program will have compilation errors, and if the error, E: / MyProject / TestNUnit2 / Form1. CS (104): Can't find the type or namespace name "NUnit" (whether it is missing the USING directive or assembly reference?) The reason is that after the NUnit is installed, the reference related to NUnit is not automatically added to the .NET environment It must be added manually. Right-click the reference in the Solution Explorer, select Add reference, select NUnit.framework in the .NET component, and then determine. Then recompile the program, there will be no errors.

For NUNIT's entry, the documents and examples thereon are good. If you don't want to see English, someone has already translated it into Chinese, and you can find "NUNIT Quick Start" to search engine.

转载请注明原文地址:https://www.9cbs.com/read-79894.html

New Post(0)