[英]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.
我想以某种方式使用C#代码执行Visual Studio单元测试。 These tests were not built for nunit.
这些测试不是为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. Team Foundation Server(TFS)可以在签入和构建过程的一部分中运行所有测试项目。 Check out this other question, Running unit tests on Team Foundation Server (TFS) builds .
找出另一个问题, 在Team Foundation Server(TFS)构建上运行单元测试 。
If you just want to run your tests from the command line, there is MSTest . 如果您只想从命令行运行测试,则可以使用MSTest 。
You can also run your VS Unit Tests if your using Team Foundation Server (TFS) and its build agents. 如果您使用Team Foundation Server(TFS)及其构建代理,则还可以运行VS单元测试。 However this may not be possible or even desirable for you.
但是,这对于您而言可能是不可能甚至不希望的。
The TeamCity build server now also has built-in support for running MSTests. 现在,TeamCity构建服务器还内置了对运行MSTests的支持。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.