How to 'Skip' data driven variations?

Nov 13, 2011 at 3:02 AM

Hi,

I am new xUnit framework and have been going through it for a week now and I am really loving it!.

The "Skip" property of a Fact attribute has been useful as we would like to Skip a particular test temporarily if we know that its caused by a known bug. In the Skip reason, one could put info about the bug # etc.

My question:

I like the data driven kind of writing tests using the various DataAttribute types. I am currently using the InlineData attribute. Currently this attribute does NOT have a Skip property kind of thing. The reason I ask is that I would like to Skip a particular data variation just for the reason i mentioned above.

How do you usually skip data variations? Following is something that I thought of, but I am curious as to if there is any other way that users are following to skip data variations...

I briefly looked at the xUnit sources and found that I could probably do the following:

a. Adding a Skip property to a derived InlineDataAttribute
b. Modify TheoryAttribute's ExecuteTestCommand() method to return a SkipCommand based on the Skip property

Thanks,
Kiran Challa

Coordinator
Nov 16, 2011 at 2:51 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.