开发者

Filter test projects executed by the TestDriven.NET runner

开发者 https://www.devze.com 2023-04-04 21:24 出处:网络
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 t

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

精彩评论

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