Skip to content

wespday/CategoryTraits.Xunit2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CategoryTraits.Xunit2

UnitTest and IntegrationTest attributes etc... for xUnit 2

NuGet Badge

Build status

Build history

Usage

Install the CategoryTraits.Xunit2 NuGet package using the Visual Studio NuGet Package Manager

    using CategoryTraits.Xunit2;
    ...
        [Fact]
        [UnitTest]
        public void MyXunitTest(...)

Why?

This is an alternative to using the built in xUnit [Trait ("Category", "Unit")] attribute. Fewer chances for typos etc... Previously in xUnit you could just subclass TraitAttribute but that class is now sealed.

See: xunit/xunit#394

Where is my SlowTest, Milestone3Test, attribute etc...?

You can easily make your own custom attributes by adding a class inheriting from CategoryTraitAttribute in your project:

    public class MyVeryOwnTestAttribute : CategoryTraitAttribute
    { 
        public MyVeryOwnTestAttribute()
            : base("MyVeryOwn")
        {
        }
    }

Building from Source?

Reqiures Visual Studio 2015. Run the build.cmd batch file.

About

UnitTest and IntegrationTest attributes etc... for xUnit 2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published