No - there is no such facility at present,
One quick way of achieving the effect in xUnit is to comment out the public
- private classes are not reflected over (obviously it won't appear on the skip list that way though).
Consider logging it as an Issue on CodePlex if you feel the need for this is sufficiently common (I personally can't imagine upvoting it as I simply don't run into cases where I need to skip an entire Test Class worth of tests).
UPDATE: Another way is to put a TraitAttribute
on the class and then (assuming you're using the xunit.console
runner) filter it out by running with /-trait traitName
. (e.g. you can achieve ExplicitAttribute
, some aspects of the BDD frameworky technique of Pending tests and similar semantics that way - of course the big problem is they don't show up in any reports when using any of these filtering techniques)
UPDATE 2: You can do
const string skip = "Class X disabled";
[Fact(Skip=skip)]
void Test() {}
Then you can change to to const string skip = null
to undo the skip. The (dis)advantage of this is that the test is still shown as a Skipped test in the test list, generally with a reason included in the test run report (vs making it private
which makes it likely to be forgotten)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…