Class PropertyConstraint
PropertyConstraint extracts a named property and uses its value as the actual value for a chained constraint.
Inherited Members
Namespace: NUnit.Framework.Constraints
Assembly: nunit.framework.dll
Syntax
public class PropertyConstraint : PrefixConstraint, IConstraint, IResolveConstraint
Constructors
View SourcePropertyConstraint(string, IConstraint)
Initializes a new instance of the PropertyConstraint class.
Declaration
public PropertyConstraint(string name, IConstraint baseConstraint)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name. |
IConstraint | baseConstraint | The constraint to apply to the property. |
Methods
View SourceApplyTo<TActual>(TActual)
Test whether the constraint is satisfied by a given value
Declaration
public override ConstraintResult ApplyTo<TActual>(TActual actual)
Parameters
Type | Name | Description |
---|---|---|
TActual | actual | The value to be tested |
Returns
Type | Description |
---|---|
ConstraintResult |
Type Parameters
Name | Description |
---|---|
TActual |
Overrides
View SourceGetStringRepresentation()
Returns the string representation of the constraint.
Declaration
protected override string GetStringRepresentation()
Returns
Type | Description |
---|---|
string |