visual-studio 如何在没有 Visual Studio 的情况下使用 MSTest?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/261290/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I use MSTest without Visual Studio?
提问by bitbonk
Does MSTest have standalone GUI similar to nUnit that lets me use it and run test without visual studio? What is the official site for MSTest where I can learn more about how to use it?
MSTest 是否具有类似于 nUnit 的独立 GUI,可让我使用它并在没有 Visual Studio 的情况下运行测试?MSTest 的官方网站是什么,我可以在那里了解有关如何使用它的更多信息?
采纳答案by Alexander Kojevnikov
It doesn't have a GUI (apart from Visual Studio) but there's a command line tool: MSTest.exe
它没有 GUI(除了 Visual Studio),但有一个命令行工具:MSTest.exe
Here is the official documentation on running MSTest tests.
这是有关运行 MSTest 测试的官方文档。
回答by boris
MSTest can be used without installing Visual Studio. You will need to install Visual Studio Test Agent, which is a free download from Microsoft.
无需安装 Visual Studio 即可使用 MSTest。您将需要安装 Visual Studio 测试代理,可从 Microsoft 免费下载。
I think this approach is better from a licensing perspective than manually copying MSTest.exe and its dependencies onto the build server.
我认为从许可的角度来看,这种方法比手动将 MSTest.exe 及其依赖项复制到构建服务器上要好。
See this blog for reference: http://blogs.msdn.com/b/anutthara/archive/2009/12/16/running-tests-in-mstest-without-installing-the-vs-ide.aspx
请参阅此博客以供参考:http: //blogs.msdn.com/b/anutthara/archive/2009/12/16/running-tests-in-mstest-without-installing-the-vs-ide.aspx
回答by Wim Coenen
回答by RhysC
回答by Peter Schmitz
You can also use this tool from codeplex: http://testrunner.codeplex.com...
您也可以从 codeplex 使用此工具:http: //testrunner.codeplex.com...
回答by Siraf
Use VSTest.console.exepart of Microsoft.TestPlatform
使用Microsoft.TestPlatform 的VSTest.console.exe部分
Required steps:
所需步骤:
- Download the test platform from https://www.nuget.org/packages/Microsoft.TestPlatform/
- Unzip
- In the unzipped folder, copy the \tools\net451\Common7\IDE\Extensions\TestPlatformfolder to the machine that has no Visual Studio installed
- From cmd.exe run VSTest.console.exe MyTest.dll
- 从https://www.nuget.org/packages/Microsoft.TestPlatform/下载测试平台
- 解压
- 在解压后的文件夹中,将\tools\net451\Common7\IDE\Extensions\TestPlatform文件夹复制到没有安装Visual Studio的机器
- 从 cmd.exe 运行VSTest.console.exe MyTest.dll
More details here:https://docs.microsoft.com/en-us/visualstudio/test/vstest-console-options?view=vs-2017#general-command-line-options
更多详细信息:https: //docs.microsoft.com/en-us/visualstudio/test/vstest-console-options?view=vs-2017#general-command-line-options

