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
stringThe name.
baseConstraint
IConstraintThe 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
TActualThe 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()