Summary
InstanceOfTypeConstraint is used to test that an object
is of the same type provided or derived from it.
- Namespace
- TCLite
.Constraints - Interfaces
- Base Types
-
- object
- Constraint
- Expected
Value Constraint <Type> - TypeConstraint
graph BT
Type-->Base0["TypeConstraint"]
click Base0 "/tc-lite/api/TCLite.Constraints/TypeConstraint"
Base0-->Base1["ExpectedValueConstraint<Type>"]
Base1-->Base2["Constraint"]
click Base2 "/tc-lite/api/TCLite.Constraints/Constraint"
Base2-->Base3["object"]
Type-.->Interface0["IConstraint"]
click Interface0 "/tc-lite/api/TCLite.Constraints/IConstraint"
Type-.->Interface1["IResolveConstraint"]
click Interface1 "/tc-lite/api/TCLite.Constraints/IResolveConstraint"
Type["InstanceOfTypeConstraint"]
class Type type-node
Syntax
public class InstanceOfTypeConstraint : TypeConstraint, IConstraint, IResolveConstraint
Constructors
Name | Summary |
---|---|
Instance |
Construct an InstanceOfTypeConstraint for the type provided |
Properties
Name | Value | Summary |
---|---|---|
ActualType | Type |
Inherited from TypeConstraint
|
And | ConstraintExpression |
Returns a ConstraintExpression by appending And
to the current constraint.
Inherited from Constraint
|
Arguments | object[] |
Arguments provided to this Constraint, for use in
formatting the description.
Inherited from Constraint
|
Builder | ConstraintBuilder |
A ConstraintBuilder holding this constraint. If not null
the constraint is under construction.
Inherited from Constraint
|
Description | string | |
DisplayName | string |
The display name of this Constraint for use by ToString().
The default value is the name of the constraint with
trailing "Constraint" removed. Derived classes may set
this to another name in their constructors.
Inherited from Constraint
|
ExpectedType | Type |
The expected Type used by the constraint
Inherited from TypeConstraint
|
Or | ConstraintExpression |
Returns a ConstraintExpression by appending Or
to the current constraint.
Inherited from Constraint
|
With | ConstraintExpression |
Returns a ConstraintExpression by appending And
to the current constraint.
Inherited from Constraint
|
Methods
Name | Value | Summary |
---|---|---|
ApplyConstraint |
ConstraintResult |
Applies the constraint to an ActualValueDelegate that returns
the value to be tested. The default implementation simply evaluates
the delegate but derived classes may override it to provide for
delayed processing.
Inherited from Constraint
|
ApplyConstraint |
ConstraintResult |
Applies the constraint to an actual value, returning a ConstraintResult.
Inherited from TypeConstraint
|
ApplyConstraint |
ConstraintResult |
Test whether the constraint is satisfied by a given reference.
The default implementation simply dereferences the value but
derived classes may override it to provide for delayed processing.
Inherited from Constraint
|
ApplyTo |
ConstraintResult |
Validates the ActualValueDelegate and applies the constraint
to the value it returns.
Inherited from Constraint
|
ApplyTo |
ConstraintResult |
Validates the actual value argument and applies the constraint
to it, returning a ConstraintResult.
Inherited from Constraint
|
ApplyTo |
ConstraintResult |
Validates the actual value argument and applies the constraint
to it, returning a ConstraintResult.
Inherited from Constraint
|
Get |
string |
Returns the string representation of this constraint
Inherited from Constraint
|
Matches |
bool |
Test whether an object is of the specified type or a derived type
|
ToString |
string |
Default override of ToString returns the constraint DisplayName
followed by any arguments within angle brackets.
Inherited from Constraint
|
ValidateActualValue |
void |
Validate the actual value argument based on what the
particular constraint allows. The default
implementation does nothing, implying that the constraint
can handle any Type as well as null values.
Inherited from Constraint
|