UnitTest and IntegrationTest attributes etc... for xUnit 2
Install the CategoryTraits.Xunit2
NuGet package using the Visual Studio NuGet Package Manager
using CategoryTraits.Xunit2;
...
[Fact]
[UnitTest]
public void MyXunitTest(...)
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
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")
{
}
}
Reqiures Visual Studio 2015. Run the build.cmd batch file.