我们有几百个测试类,其中几十个标有以下属性:[TestFixture] [Explicit] [Category("IntegrationTests")]因此它们只能在我们的夜间自动构建中运行.其余的TestFixtures没有指定类别(也没有标记为Explicit).
这是我们为执行测试而运行的NAnt任务:
<nunit2>
<test>
...
<categories>
<include name="IntegrationTests" />
</categories>
...
</test>
</nunit2>
Run Code Online (Sandbox Code Playgroud)
当然,这不会执行任何未分类的测试.
我希望能够做到这样的事情:
<nunit2>
<test>
...
<categories>
<include name="*" />
<include name="IntegrationTests" />
</categories>
...
</test>
</nunit2>
Run Code Online (Sandbox Code Playgroud)
所有未分类的测试都将与集成测试一起运行.这可能吗?如果是这样,语法是什么?
(注意:我正在寻找一个NAnt解决方案,如上所述,或NUnit命令行解决方案.我当然可以使用不同的选项运行NUnit两次,或者在我的所有TestFixtures上放置类别.这些是我的解决方法如果必须,可以使用,但是能够直接指定未分类的测试会更酷.)