我有以下设置 Visual Studio 2012 Update 2 NUnit Test Adapter Beta 4 NUnit 2.62
我使用来自 NUnit 的以下属性 Category 或来自 MSTest 的 TestCategory 标记测试:
[Category("WebServer")]
public void FooTest() {
//test
}
[TestCategory("WebServer")]
public void FooTest2() {
//test
}
在 TFS 构建模板中,我设置了属性
- Basic -> 1. Test Source -> Test Case Filter to the value: TestCategory!=WebServer
当构建执行 NO TESTS 时执行。移除过滤器并再次运行所有测试。
构建日志的输出是
C:\Builds\2\Proj\Build\bin\Debug\Tests.Integration.dll C:\Builds\2\Proj\Build\bin\Debug\Tests.Unit.dll C:\Builds\ 中没有可用的测试2\Proj\Build\bin\Debug\Tests.Web.dll C:\Builds\2\Proj\Build\bin\Debug\TestStack.BDDfy.dll。确保已安装的测试发现器和执行器、平台和框架版本设置正确,然后重试。
有什么线索可以让我根据类别名称排除测试吗?如果我使用 NUnit 控制台运行程序,我可以轻松验证该属性是否有效。