XUnit is a new unit test tool developed by the Nnit development team.
There are two parts: one is to directly reference the dll package to the project in the form of source code or dll package. The source code is hosted on Microsoft's open-source project website www. codeplex. cm. The URL is http://xunit.codeplex.com/. the usage instructions can be used. XUnit source code library help documentation can be downloaded through the following address (chm File Format) http://xunit.codeplex.com/releases/view/62840#DownloadId=218998.
The other part is the xUnit tool for viewing and debugging whether the test code passes. Yes: http://xunit.codeplex.com/releases/view/62840#DownloadId=218998
After downloading and unzipping, the following file appears
Xunit.installer.exe allows you to install some vs integration tools, such
The arrow points to some tools I have installed. Click Apply.
XUnit provides two ways to view the test results of a test project: Command Line and interface operation.
1. Interface operations:
If your test project uses. net framework 4.0, double-click xunit.gui.clr4.exe.
If your test project uses. net framework 2.0, double-click xunit.gui.exe.
2. command line tool
Similarly
Locate the directory of the file in the command line tool.
For example: "cd F: \ Files \ xunit-1.8", "F: \ Files \ xunit-1.8" download and decompress the directory.
If you use. net framework 4.0, enter "xunit. console. clr4 E: \ work \ ValorCom \ Valor. rabbit. controllers. tests \ bin \ Debug \ Valor. rabbit. controllers. tests. dll ".
If your test project uses. net framework 2.0,
Enter "xunit. console E: \ work \ ValorCom \ Valor. Rabbit. Controllers. Tests \ bin \ Debug \ Valor. Rabbit. Controllers. Tests. dll ".
"E: \ work \ ValorCom \ Valor. rabbit. controllers. tests \ bin \ Debug \ Valor. rabbit. controllers. tests. dll "is the path of my test project dll.
TIPS: If you want to locate the directory where the xunit tool is located, you can put it in the environment variable, right-click the computer and select Properties,
Enter the file path of the xUnit tool here. Add a semicolon (;) to the path ";".
In this way, you can directly use xunit. console. clr4 or xunit. console Commands in any directory in the command line,
Example: xunit. console. clr4 E: \ work \ ValorCom \ Valor. Rabbit. Controllers. Tests \ bin \ Debug \ Valor. Rabbit. Controllers. Tests. dll