Table of Contents

Class PropertyAttribute

Namespace
NUnit.Framework
Assembly
nunit.framework.dll

PropertyAttribute is used to attach information to a test as a name/value pair..

[AttributeUsage(AttributeTargets.Assembly|AttributeTargets.Class|AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
public class PropertyAttribute : NUnitAttribute, IApplyToTest
Inheritance
PropertyAttribute
Implements
Derived
Inherited Members

Constructors

PropertyAttribute()

Constructor for derived classes that set the property dictionary directly.

protected PropertyAttribute()

PropertyAttribute(object)

Constructor for use by derived classes that use the name of the type as the property name. Derived classes must ensure that the Type of the property value is a standard type supported by the BCL. Any custom types will cause a serialization Exception when in the client.

protected PropertyAttribute(object propertyValue)

Parameters

propertyValue object

PropertyAttribute(string, double)

Construct a PropertyAttribute with a name and double value

public PropertyAttribute(string propertyName, double propertyValue)

Parameters

propertyName string

The name of the property

propertyValue double

The property value

PropertyAttribute(string, int)

Construct a PropertyAttribute with a name and int value

public PropertyAttribute(string propertyName, int propertyValue)

Parameters

propertyName string

The name of the property

propertyValue int

The property value

PropertyAttribute(string, string)

Construct a PropertyAttribute with a name and string value

public PropertyAttribute(string propertyName, string propertyValue)

Parameters

propertyName string

The name of the property

propertyValue string

The property value

Properties

Properties

Gets the property dictionary for this attribute

public IPropertyBag Properties { get; }

Property Value

IPropertyBag

Methods

ApplyToTest(Test)

Modifies a test by adding properties to it.

public virtual void ApplyToTest(Test test)

Parameters

test Test

The test to modify