【发布时间】:2017-06-16 22:40:09
【问题描述】:
最新版本的 VS Code 已经提供了一种运行单个测试的简单方法,正如 Tyler Long's answer 对问题 Debugging xunit tests in .NET Core and Visual Studio Code 所指出的那样。
但是,我正在寻找如何运行 VS Code 中的测试套件类中包含的所有测试(无需调试)?
我发现的唯一方法是在launch.json 中添加一个特定配置,如下所示,但我只能在调试中运行(我想在不调试的情况下运行它):
{
"name": ".NET Core Xunit tests",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "/usr/local/share/dotnet/dotnet",
"args": ["test"],
"cwd": "${workspaceRoot}/test/MyProject.Tests",
"externalConsole": false,
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart"
}
【问题讨论】:
标签: .net visual-studio-code .net-core xunit.net