Skip to content

Instantly share code, notes, and snippets.

@mhoyer
Last active September 30, 2015 14:08
Show Gist options
  • Save mhoyer/1804317 to your computer and use it in GitHub Desktop.
Save mhoyer/1804317 to your computer and use it in GitHub Desktop.
Using TagAttribute with StatLight and its -t argument
[TestClass]
public class Salutes
{
[TestMethod]
public void ItShouldSayHello() { }
[TestMethod, Tag("Important")]
public void ItShouldSayGoodBye() { }
[TestMethod, Tag("Ignore")]
public void ItShouldSaySomething() { }
}
// StatLight.exe -x=Salutes.Tests.xap # runs all two test methods
// StatLight.exe -x=Salutes.Tests.xap -t=Important # runs ItShouldSayGoodBye only
// StatLight.exe -x=Salutes.Tests.xap -t=!Important # runs ItShouldSayHello and ItShouldSaySomething only
// StatLight.exe -x=Salutes.Tests.xap -t=!(Important+Ignore) # runs neither ItShouldSayHello nor ItShouldSaySomething
// The TagAttribute can be used on class level as well.
[TestClass, Tag("Exclude")]
public class Test
{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment