Table of Contents

Class ValuesAttribute

Namespace
NUnit.Framework
Assembly
nunit.framework.dll

ValuesAttribute is used to provide literal arguments for an individual parameter of a test.

[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
public class ValuesAttribute : DataAttribute, IParameterDataSource
Inheritance
ValuesAttribute
Implements
Derived
Inherited Members

Constructors

ValuesAttribute()

Constructs for use with an Enum parameter. Will pass every enum value in to the test.

public ValuesAttribute()

ValuesAttribute(object)

Construct with one argument

public ValuesAttribute(object arg1)

Parameters

arg1 object

ValuesAttribute(object, object)

Construct with two arguments

public ValuesAttribute(object arg1, object arg2)

Parameters

arg1 object
arg2 object

ValuesAttribute(object, object, object)

Construct with three arguments

public ValuesAttribute(object arg1, object arg2, object arg3)

Parameters

arg1 object
arg2 object
arg3 object

ValuesAttribute(params object[])

Construct with an array of arguments

public ValuesAttribute(params object[] args)

Parameters

args object[]

Fields

data

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

protected object[] data

Field Value

object[]

Methods

GetData(ParameterInfo)

Get the collection of _values to be used as arguments

public IEnumerable GetData(ParameterInfo parameter)

Parameters

parameter ParameterInfo

Returns

IEnumerable