Last active
August 29, 2015 13:57
-
-
Save JayBazuzi/9786331 to your computer and use it in GitHub Desktop.
Mark certain XUnit tests as "expensive" so they don't get run by default.
This file contains hidden or 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
class ExpensiveFactAttribute : FactAttribute | |
{ | |
public ExpensiveFactAttribute() | |
{ | |
// remove this line to run these expensive tests | |
base.Skip = "Expensive"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For example, suppose you want to test the code that calls in to a service that charges you $0.10 each time. Weekly that's fine; every 10 seconds and it becomes a problem.
Or maybe after the test runs you have to clean up the mess that it makes.
Or maybe the test is inherently slow.