Table of Contents generated with DocToc
Invio's extensions to xunit that is based on our coding practices and standards.
The latest version of this package is available on NuGet. To install add the dependency to your project.json.
PM> Install-Package Invio.Xunit
Features included here are what makes this library useful
Category attributes allow you to specify strongly typed classes which add the category as traits to the test method or class. This will allow for filtering execution runs based on these categories.
using Invio.Xunit;
...
[UnitTest]
public class UnitTestFixture {
}
[IntegrationTest]
public class IntegrationTestFixture {
}
public class TestFixture {
[UnitTest]
[Fact]
pulic void UnitTestMethod() {
}
[IntegrationTest]
[Fact]
pulic void IntegrationTestMethod() {
}
}
Filtering which tests run via the command line is done using --filter
.
# This will just run tests that are marked as Unit Tests
$> dotnet test --filter Category=Unit
# This will just run tests that are not marked as Integration
$> dotnet test --filter Category!=Integration