Basic use of xUnit asp.net unit test tools

Source: Internet
Author: User
Tags xunit

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.