Skip to content

Instantly share code, notes, and snippets.

@danielwertheim
Created April 14, 2014 12:59
Show Gist options
  • Save danielwertheim/10645604 to your computer and use it in GitHub Desktop.
Save danielwertheim/10645604 to your computer and use it in GitHub Desktop.
Custom xUnit attribute
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