Skip to content

Extensions to XUnit for Invio's Coding Style and Standards

License

Notifications You must be signed in to change notification settings

invio/Invio.Xunit

Repository files navigation

Table of Contents generated with DocToc

Invio.Xunit

Appveyor Travis CI NuGet Coverage

Invio's extensions to xunit that is based on our coding practices and standards.

Installation

The latest version of this package is available on NuGet. To install add the dependency to your project.json.

PM> Install-Package Invio.Xunit

Noteworthy Features

Features included here are what makes this library useful

Category Attributes

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

About

Extensions to XUnit for Invio's Coding Style and Standards

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published