Class ValueSourceAttribute
Indicates the source used to provide data for one parameter of a test method.
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = true, Inherited = false)]
public class ValueSourceAttribute : NUnitAttribute, IParameterDataSource
- Inheritance
-
ValueSourceAttribute
- Implements
- Inherited Members
Constructors
ValueSourceAttribute(string?)
Construct with the name of the factory - for use with languages that don't support params arrays.
public ValueSourceAttribute(string? sourceName)
Parameters
sourceName
stringThe name of a static method, property or field that will provide data.
ValueSourceAttribute(Type?, string?)
Construct with a Type and name - for use with languages that don't support params arrays.
public ValueSourceAttribute(Type? sourceType, string? sourceName)
Parameters
sourceType
TypeThe Type that will provide data
sourceName
stringThe name of a static method, property or field that will provide data.
Properties
SourceName
The name of a the method, property or field to be used as a source
public string? SourceName { get; }
Property Value
SourceType
A Type to be used as a source
public Type? SourceType { get; }
Property Value
Methods
GetData(IParameterInfo)
Retrieves a list of arguments which can be passed to the specified parameter.
public IEnumerable GetData(IParameterInfo parameter)
Parameters
parameter
IParameterInfoThe parameter of a parameterized test.