|
8 | 8 | using Xunit.Abstractions;
|
9 | 9 | using Xunit.Sdk;
|
10 | 10 |
|
11 |
| -/// <summary> |
12 |
| -/// This is a replacement for the MSTest [TestCategoryAttribute] on xunit |
13 |
| -/// xunit does not have the concept of Category for tests and instead, the have [TraitAttribute(string key, string value)] |
14 |
| -/// If we replace the MSTest [TestCategoryAttribute] for the [Trait("Category", "BVT")], we will surely fall at some time in cases |
15 |
| -/// where people will typo on the "Category" key part of the Trait. |
16 |
| -/// On order to achieve the same behaviour as on MSTest, a custom [TestCategory] was created |
17 |
| -/// to mimic the MSTest one and avoid replace it on every existent test. |
18 |
| -/// The tests can be filtered by xunit runners by usage of "-trait" on the command line with the expresion like |
19 |
| -/// <code>-trait "Category=BVT"</code> for example that will only run the tests with [TestCategory("BVT")] on it. |
20 |
| -/// </summary> |
21 |
| - |
22 | 11 | namespace Xunit
|
23 | 12 | {
|
| 13 | + /// <summary> |
| 14 | + /// This is a replacement for the MSTest [TestCategoryAttribute] on xunit |
| 15 | + /// xunit does not have the concept of Category for tests and instead, the have [TraitAttribute(string key, string value)] |
| 16 | + /// If we replace the MSTest [TestCategoryAttribute] for the [Trait("Category", "BVT")], we will surely fall at some time in cases |
| 17 | + /// where people will typo on the "Category" key part of the Trait. |
| 18 | + /// On order to achieve the same behaviour as on MSTest, a custom [TestCategory] was created |
| 19 | + /// to mimic the MSTest one and avoid replace it on every existent test. |
| 20 | + /// The tests can be filtered by xunit runners by usage of "-trait" on the command line with the expresion like |
| 21 | + /// <code>-trait "Category=BVT"</code> for example that will only run the tests with [TestCategory("BVT")] on it. |
| 22 | + /// </summary> |
24 | 23 | [TraitDiscoverer("CategoryDiscoverer", "TestExtensions")]
|
25 | 24 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)]
|
26 | 25 | public class TestCategoryAttribute : Attribute, ITraitAttribute
|
|
0 commit comments