Summary
ThrowsConstraint is used to test the exception thrown by
a delegate by applying a constraint to it.
- Namespace
- TCLite
.Constraints - Interfaces
- Base Types
-
- object
- Constraint
- PrefixConstraint
graph BT
Type-->Base0["PrefixConstraint"]
click Base0 "/tc-lite/api/TCLite.Constraints/PrefixConstraint"
Base0-->Base1["Constraint"]
click Base1 "/tc-lite/api/TCLite.Constraints/Constraint"
Base1-->Base2["object"]
Type-.->Interface0["IConstraint"]
click Interface0 "/tc-lite/api/TCLite.Constraints/IConstraint"
Type-.->Interface1["IResolveConstraint"]
click Interface1 "/tc-lite/api/TCLite.Constraints/IResolveConstraint"
Type["ThrowsConstraint"]
class Type type-node
Syntax
public class ThrowsConstraint : PrefixConstraint, IConstraint, IResolveConstraint
Constructors
Name | Summary |
---|---|
ThrowsConstraint |
Initializes a new instance of the ThrowsConstraint class,
using a constraint to be applied to the exception.
|
Properties
Name | Value | Summary |
---|---|---|
ActualException | Exception |
Get the actual exception thrown - used by Assert.Throws.
|
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
|
BaseConstraint | IConstraint |
The base constraint
Inherited from PrefixConstraint
|
Builder | ConstraintBuilder |
A ConstraintBuilder holding this constraint. If not null
the constraint is under construction.
Inherited from Constraint
|
Description | string |
The Description of what this constraint tests, for
use in messages and in the ConstraintResult.
Inherited from PrefixConstraint
|
DescriptionPrefix | string |
Prefix used in forming the constraint description
Inherited from PrefixConstraint
|
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
|
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 |
Converts an ActualValueDelegate to a TestDelegate
before calling the primary overload.
|
ApplyConstraint |
ConstraintResult |
Executes the code of the delegate and captures any exception.
If a non-null base constraint was provided, it applies that
constraint to the exception.
|
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
|
ToString |
string |
Default override of ToString returns the constraint DisplayName
followed by any arguments within angle brackets.
Inherited from Constraint
|
ValidateActualValue |
void |