简体   繁体   中英

How can I run Microsoft Visual Studio Units Tests in an automated way using .NET code?

We have a build and deployment tool and as part of the tool before a deployment I want to validate that all of our unit tests run. I want to execute the Visual Studio unit tests using C# code if possible in some way. These tests were not built for nunit. Are there any good articles or ways of doing this that someone could recommend?

Team Foundation Server (TFS) can run all your test projects as a part of the check-in and build process. Check out this other question, Running unit tests on Team Foundation Server (TFS) builds .

If you just want to run your tests from the command line, there is MSTest .

You can also run your VS Unit Tests if your using Team Foundation Server (TFS) and its build agents. However this may not be possible or even desirable for you.

The TeamCity build server now also has built-in support for running MSTests.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM