Class ValuesAttribute
Provides literal arguments for an individual parameter of a test.
Implements
Inherited Members
Namespace: NUnit.Framework
Assembly: nunit.framework.dll
Syntax
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
public class ValuesAttribute : NUnitAttribute, IParameterDataSource
Constructors
View SourceValuesAttribute()
Constructs for use with an Enum parameter. Will pass every enum value in to the test.
Declaration
public ValuesAttribute()
ValuesAttribute(object?)
Construct with one argument
Declaration
public ValuesAttribute(object? arg1)
Parameters
Type | Name | Description |
---|---|---|
object | arg1 |
ValuesAttribute(object?, object?)
Construct with two arguments
Declaration
public ValuesAttribute(object? arg1, object? arg2)
Parameters
Type | Name | Description |
---|---|---|
object | arg1 | |
object | arg2 |
ValuesAttribute(object?, object?, object?)
Construct with three arguments
Declaration
public ValuesAttribute(object? arg1, object? arg2, object? arg3)
Parameters
Type | Name | Description |
---|---|---|
object | arg1 | |
object | arg2 | |
object | arg3 |
ValuesAttribute(params object?[]?)
Construct with an array of arguments
Declaration
public ValuesAttribute(params object?[]? args)
Parameters
Type | Name | Description |
---|---|---|
object[] | args |
Fields
View Sourcedata
The collection of data to be returned. Must be set by any derived attribute classes. We use an object[] so that the individual elements may have their type changed in GetData if necessary
Declaration
protected object?[] data
Field Value
Type | Description |
---|---|
object[] |
Methods
View SourceGetData(IParameterInfo)
Retrieves a list of arguments which can be passed to the specified parameter.
Declaration
public IEnumerable GetData(IParameterInfo parameter)
Parameters
Type | Name | Description |
---|---|---|
IParameterInfo | parameter | The parameter of a parameterized test. |
Returns
Type | Description |
---|---|
IEnumerable |