Provides a base class for attributes that will provide member data. The member data must return something compatible with IEnumerable. Caution: the property is completely enumerated by .ToList() before any test is run. Hence it should return independent object sets.
More...
|
override IEnumerable< object[]> | GetData (MethodInfo testMethod) |
| Returns the data to be used to test the theory.
|
|
|
bool | DisableDiscoveryEnumeration [get, set] |
| Returns true if the data attribute wants to skip enumerating data during discovery. This will cause the theory to yield a single test case for all data, and the data discovery will be during test execution instead of discovery. More...
|
|
string | MemberName [get] |
| Gets the member name. More...
|
|
Type | MemberType [get, set] |
| Gets or sets the type to retrieve the member from. If not set, then the property will be retrieved from the unit test class. More...
|
|
object [] | Parameters [get] |
| Gets or sets the parameters passed to the member. Only supported for static methods. More...
|
|
virtual string | Skip [get, set] |
| Marks all test cases generated by this data source as skipped. More...
|
|
Provides a base class for attributes that will provide member data. The member data must return something compatible with IEnumerable. Caution: the property is completely enumerated by .ToList() before any test is run. Hence it should return independent object sets.
◆ MemberDataAttributeBase()
Xunit.MemberDataAttributeBase.MemberDataAttributeBase |
( |
string |
memberName, |
|
|
object [] |
parameters |
|
) |
| |
|
inlineprotected |
Initializes a new instance of the MemberDataAttributeBase class.
- Parameters
-
memberName | The name of the public static member on the test class that will provide the test data |
parameters | The parameters for the member (only supported for methods; ignored for everything else) |
◆ ConvertDataItem()
abstract object [] Xunit.MemberDataAttributeBase.ConvertDataItem |
( |
MethodInfo |
testMethod, |
|
|
object |
item |
|
) |
| |
|
protectedpure virtual |
Converts an item yielded by the data member to an object array, for return from GetData.
- Parameters
-
testMethod | The method that is being tested. |
item | An item yielded from the data member. |
- Returns
- An T:object[] suitable for return from GetData.
Implemented in Xunit.MemberDataAttribute.
◆ DisableDiscoveryEnumeration
bool Xunit.MemberDataAttributeBase.DisableDiscoveryEnumeration |
|
getset |
Returns true
if the data attribute wants to skip enumerating data during discovery. This will cause the theory to yield a single test case for all data, and the data discovery will be during test execution instead of discovery.
◆ MemberName
string Xunit.MemberDataAttributeBase.MemberName |
|
get |
◆ MemberType
Type Xunit.MemberDataAttributeBase.MemberType |
|
getset |
Gets or sets the type to retrieve the member from. If not set, then the property will be retrieved from the unit test class.
◆ Parameters
object [] Xunit.MemberDataAttributeBase.Parameters |
|
get |
Gets or sets the parameters passed to the member. Only supported for static methods.
The documentation for this class was generated from the following file:
- xunit/src/xunit.core/MemberDataAttributeBase.cs