Table of Contents

Class ValuesAttribute

Namespace
NUnit.Framework
Assembly
nunit.framework.dll

Provides literal arguments for an individual parameter of a test.

[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
public class ValuesAttribute : NUnitAttribute, IParameterDataSource
Inheritance
ValuesAttribute
Implements
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(IParameterInfo)

Retrieves a list of arguments which can be passed to the specified parameter.

public IEnumerable GetData(IParameterInfo parameter)

Parameters

parameter IParameterInfo

The parameter of a parameterized test.

Returns

IEnumerable