Interface IDataDiscoverer
This class is responsible for discovering the data available in an implementation of DataAttribute. The discovery process may not always have access to reflection (i.e., running in Resharper), so the discoverer must make a best effort to return data, but may return null when there is not enough information available (for example, if reflection is required to answer the question).
Namespace: Xunit.Sdk
Assembly: xunit.core.dll
Syntax
public interface IDataDiscoverer
Methods
| Improve this Doc View SourceGetData(IAttributeInfo, IMethodInfo)
Returns the data to be used to test the theory.
Declaration
IEnumerable<object[]> GetData(IAttributeInfo dataAttribute, IMethodInfo testMethod)
Parameters
Type | Name | Description |
---|---|---|
IAttributeInfo | dataAttribute | The data attribute being discovered |
IMethodInfo | testMethod | The method that is being tested/discovered |
Returns
Type | Description |
---|---|
IEnumerable<Object[]> | The theory data (or null during discovery, if not enough information is available to enumerate the data) |
Remarks
This will be called during
discovery, at which point the testMethod
may or may not
be backed by reflection (i.e., implementing
SupportsDiscoveryEnumeration(IAttributeInfo, IMethodInfo)
Returns true
if the data attribute supports enumeration during
discovery; false
otherwise. Data attributes with expensive computational
costs and/or randomized data sets should return false
.
Declaration
bool SupportsDiscoveryEnumeration(IAttributeInfo dataAttribute, IMethodInfo testMethod)
Parameters
Type | Name | Description |
---|---|---|
IAttributeInfo | dataAttribute | |
IMethodInfo | testMethod |
Returns
Type | Description |
---|---|
Boolean |