Table of Contents

Class PropertyConstraint

Namespace
NUnit.Framework.Constraints
Assembly
nunit.framework.dll

PropertyConstraint extracts a named property and uses its value as the actual value for a chained constraint.

public class PropertyConstraint : PrefixConstraint, IConstraint, IResolveConstraint
Inheritance
PropertyConstraint
Implements
Inherited Members

Constructors

PropertyConstraint(string, IConstraint)

Initializes a new instance of the PropertyConstraint class.

public PropertyConstraint(string name, IConstraint baseConstraint)

Parameters

name string

The name.

baseConstraint IConstraint

The constraint to apply to the property.

Methods

ApplyTo<TActual>(TActual)

Test whether the constraint is satisfied by a given value

public override ConstraintResult ApplyTo<TActual>(TActual actual)

Parameters

actual TActual

The value to be tested

Returns

ConstraintResult

True for success, false for failure

Type Parameters

TActual

GetStringRepresentation()

Returns the string representation of the constraint.

protected override string GetStringRepresentation()

Returns

string