ThrowsConstraint is used to test the exception thrown by a delegate by applying a constraint to it.
More...
|
Exception | ActualException [get] |
| Get the actual exception thrown - used by Assert.Throws. More...
|
|
override string | Description [get] |
| Gets text describing a constraint More...
|
|
override string | Description [get] |
| The Description of what this constraint tests, for use in messages and in the ConstraintResult. More...
|
|
string | DisplayName [get, protected set] |
| 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. More...
|
|
virtual string | Description [get, protected set] |
| The Description of what this constraint tests, for use in messages and in the ConstraintResult. More...
|
|
object[] | Arguments [get, private set] |
| Arguments provided to this Constraint, for use in formatting the description. More...
|
|
ConstraintBuilder | Builder [get, set] |
| The ConstraintBuilder holding this constraint More...
|
|
ConstraintExpression | And [get] |
| Returns a ConstraintExpression by appending And to the current constraint. More...
|
|
ConstraintExpression | With [get] |
| Returns a ConstraintExpression by appending And to the current constraint. More...
|
|
ConstraintExpression | Or [get] |
| Returns a ConstraintExpression by appending Or to the current constraint. More...
|
|
string | DisplayName [get] |
| The display name of this Constraint for use by ToString(). More...
|
|
string | Description [get] |
| The Description of what this constraint tests, for use in messages and in the ConstraintResult. More...
|
|
object[] | Arguments [get] |
| Arguments provided to this Constraint, for use in formatting the description. More...
|
|
ConstraintBuilder | Builder [get, set] |
| The ConstraintBuilder holding this constraint More...
|
|
ThrowsConstraint is used to test the exception thrown by a delegate by applying a constraint to it.
NUnit.Framework.Constraints.ThrowsConstraint.ThrowsConstraint |
( |
IConstraint |
baseConstraint | ) |
|
|
inline |
Initializes a new instance of the ThrowsConstraint class, using a constraint to be applied to the exception.
- Parameters
-
baseConstraint | A constraint to apply to the caught exception. |
override ConstraintResult NUnit.Framework.Constraints.ThrowsConstraint.ApplyTo< TActual > |
( |
TActual |
actual | ) |
|
|
inlinevirtual |
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.
- Parameters
-
actual | A delegate representing the code to be tested |
- Returns
- True if an exception is thrown and the constraint succeeds, otherwise false
Implements NUnit.Framework.Constraints.Constraint.
Exception NUnit.Framework.Constraints.ThrowsConstraint.caughtException |
|
private |
Exception NUnit.Framework.Constraints.ThrowsConstraint.ActualException |
|
get |
override string NUnit.Framework.Constraints.ThrowsConstraint.Description |
|
get |
Gets text describing a constraint
The documentation for this class was generated from the following file: