xUnit.netextensions support data-driven tests called Theories. Such tests are similar to regular xUnit.net tests but instead of being decorated with [Fact] they are decorated with [Theory].
Below is a data-driven test with the data coming a Microsoft Excel (.xls) spreadsheet.
Also, a data-driven test with the data coming from a type implementing the IEnumerable<object>.
In the above samples, [ExcelData] and [ClassData] are attributes representing a data source for a data-driven test.
Using data from multiple attributes
Below is a data-driven test with the data coming from a type implementing the IEnumerable<object> combined with the data coming from an .xls spreadsheet.
Creating a composite attribute
The [ClassExcelData] from the previous example is a composite of two xUnit.net’s data attributes [ClassData] and [ExcelData].
All we have to do is create a type deriving from CompositeDataAttribute, passing in its base constructor an array of the data attributes we would like to compose.
The description for the CompositeDataAttribute algorithm can be found here.
When defining a composite data attribute, it is acceptable for the first attribute to provide some (or all) data for the parameters of the test method. However, subsequent data attributes must be able to provide the data for the exact position where the previous attribute stopped.