开发者

Filter test projects executed by the TestDriven.NET runner

Is it possible to filter which 开发者_运维知识库test projects are executed when using the TestDriven.NET runner in the solution explorer? I want to run the unit tests without running the integration tests, as the latter ones take longer to run.


In Visual Studio, go to Tools/Options/TestDriven.Net where you can specify which categories to include and exclude. You can separate categories with ';'. You can mark a test with a category by applying the category attribute:

[Test]
[Category("Integration")]
public void Test_IntegrationIsWorking()
{
   // do some testing
}

You can also apply a category to a whole test fixture:

[TestFixture]
[Category("Integration")]
public class IntegrationTests
{
    [Test]
    public void Test_IntegrationIsWorking()
    {
        // do some testing
    }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜