-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6da7d99
commit 8e656f6
Showing
4 changed files
with
71 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using Xunit.Abstractions; | ||
using Xunit.Sdk; | ||
|
||
namespace Xunit.Categories | ||
{ | ||
|
||
[TraitDiscoverer(SystemTestDiscoverer.DiscovererTypeName, DiscovererUtil.AssemblyName)] | ||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)] | ||
public class SystemTestAttribute : Attribute, ITraitAttribute | ||
{ | ||
public SystemTestAttribute(string id) | ||
{ | ||
this.Id = id; | ||
} | ||
|
||
public SystemTestAttribute(long id) | ||
{ | ||
this.Id = id.ToString(); | ||
} | ||
|
||
public SystemTestAttribute() | ||
{ | ||
|
||
} | ||
|
||
public string Id { get; private set; } | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using Xunit.Abstractions; | ||
using Xunit.Sdk; | ||
|
||
namespace Xunit.Categories | ||
{ | ||
public class SystemTestDiscoverer : ITraitDiscoverer | ||
{ | ||
internal const string DiscovererTypeName = DiscovererUtil.AssemblyName + "." + nameof(SystemTestDiscoverer); | ||
|
||
public IEnumerable<KeyValuePair<string, string>> GetTraits(IAttributeInfo traitAttribute) | ||
{ | ||
var bugId = traitAttribute.GetNamedArgument<string>("Id"); | ||
|
||
|
||
yield return new KeyValuePair<string, string>("Category", "SystemTest"); | ||
|
||
if (!string.IsNullOrWhiteSpace(bugId)) | ||
yield return new KeyValuePair<string, string>("SystemTest", bugId); | ||
|
||
} | ||
} | ||
} |
This file contains 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
This file contains 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