Created
April 14, 2014 12:59
-
-
Save danielwertheim/10645604 to your computer and use it in GitHub Desktop.
Custom xUnit attribute
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
public class MyFactAttribute : FactAttribute | |
{ | |
public MyFactAttribute(params string[] scenarios) | |
{ | |
if(!scenarios.Any() || IntegrationTestsRuntime.Environment.SupportsEverything) | |
return; | |
if (!scenarios.All(r => IntegrationTestsRuntime.Environment.HasSupportFor(r))) | |
Skip = string.Format("TestEnvironment does not support ALL test scenario(s): '{0}'.", string.Join("|", scenarios)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment