Use VS2015 (c #) for unit testing, display test results and view code coverage,

Source: Internet
Author: User

Use VS2015 (c #) for unit testing, display test results and view code coverage,

Refer to the following link for the process of creating a test:

Http://www.cnblogs.com/libaoquan/p/5296384.html

(1) how to use VS2015 to view test results

Problem description: run the unit test with VS2010. The following test result window is displayed.

VS2015 only has the following results:

After searching for relevant information, it is found that VS2010 will automatically generate this. trx file, which is the test report when it is opened.

 

The trx file is not automatically exported after VS2012.

You can use vstest.lele.exe to output the test results.

The parameters in the command line are described as follows:

1: full path of vstest.lele.exe; 2: Full path of the unit test DLL; 3:/Logger: trx, which indicates output of the trx file;

Run the following command to display the path of the trx result file:

(2) How to Use VS2015 to analyze code coverage

View code coverage results

Note: VS2015 Enterprise version is currently used.

VS2015 Community does not provide the code coverage analysis function.

Recently, we need to use VS2015 for unit tests and output the test results. You are welcome to discuss them together.

 

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.