Visual Studio unit test 4-generic test

Source: Internet
Author: User

The generic here I think is more suitable for external testing. In this test mode, Visual Studio only starts an externalProgramThen, the running result is determined by the return value (0: passed, other values: Failed.

So far, I haven't thought of its specific purpose. Maybe Microsoft is trying to be compatible with other testing tools. For example, call nuint as an external program to run some test cases.

Create a generic test:

Add-> generic test: Write the external program path to run in the first input box.

 

Other options, such as command line parameters, can be added as needed.

In this case, you can see the new generic test in the test List editor window.

 

You can run the command to view the result.

 

 

Generic test has been completed. What I want to say is that generic test is actually not difficult, but it is difficult to use it. I imagine a situation where, in a large project, I used to use other testing tools for testing (such as nunit) and had a large number of test cases. Now I use vs test instead, it is impossible to migrate all the previous use cases. That is to say, two test tools must be used together. In this case, the advantage of generic test is shown. For example, we can run the generic together with other tests or combine them into sequential tests.

 

If you need to reprint, please indicate the original from the wolf's blog: http://blog.csdn.net/tjvictor

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.