Original article: Visual Studio unit test 4 --- generic test
The generic here I think is more suitable for external testing. In this test mode, Visual Studio only starts an external program and then judges the running result through 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
Visual Studio unit test 4 --- generic test