Class ThrowsNothingConstraint
ThrowsNothingConstraint tests that a delegate does not throw an exception.
Inherited Members
Namespace: NUnit.Framework.Constraints
Assembly: nunit.framework.dll
Syntax
public class ThrowsNothingConstraint : Constraint, IConstraint, IResolveConstraint
Constructors
View SourceThrowsNothingConstraint()
Declaration
public ThrowsNothingConstraint()
Properties
View SourceDescription
Gets text describing a constraint
Declaration
public override string Description { get; }
Property Value
Type | Description |
---|---|
string |
Overrides
Methods
View SourceApplyTo<TActual>(ActualValueDelegate<TActual>)
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.
Declaration
public override ConstraintResult ApplyTo<TActual>(ActualValueDelegate<TActual> del)
Parameters
Type | Name | Description |
---|---|---|
ActualValueDelegate<TActual> | del | An ActualValueDelegate |
Returns
Type | Description |
---|---|
ConstraintResult | A ConstraintResult |
Type Parameters
Name | Description |
---|---|
TActual |
Overrides
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 | True if no exception is thrown, otherwise false |
Type Parameters
Name | Description |
---|---|
TActual |