Created
September 1, 2018 19:04
-
-
Save Kritner/ac918a184e771978de8666567e98e124 to your computer and use it in GitHub Desktop.
"Strongly typed" NUnit categories
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Haven't figured out how to apply to assembly correctly, but added it as a flag in my base anyway | |
| [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method)] | |
| public class BaseCategoryAttribute : CategoryAttribute { } | |
| public class FastIntegrationTestAttribute : BaseCategoryAttribute { } | |
| public class LongRunningIntegrationTestAttribute : BaseCategoryAttribute { } | |
| public class UnitTestAttribute : BaseCategoryAttribute { } | |
| public class CoreTestAttribute : BaseCategoryAttribute { } | |
| [TestFixture, UnitTest, CoreTest] | |
| public class SomeClassTests | |
| { | |
| // This test has categories TestFixture, UnitTest, CoreTest | |
| [Test, CoreTest] | |
| public void ShouldDoSomething() | |
| { | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment