Table of Contents

Class ThrowsNothingConstraint

Namespace
NUnit.Framework.Constraints
Assembly
nunit.framework.dll

ThrowsNothingConstraint tests that a delegate does not throw an exception.

public class ThrowsNothingConstraint : Constraint, IConstraint, IResolveConstraint
Inheritance
ThrowsNothingConstraint
Implements
Inherited Members

Constructors

ThrowsNothingConstraint()

public ThrowsNothingConstraint()

Properties

Description

Gets text describing a constraint

public override string Description { get; }

Property Value

string

Methods

ApplyTo<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.

public override ConstraintResult ApplyTo<TActual>(ActualValueDelegate<TActual> del)

Parameters

del ActualValueDelegate<TActual>

An ActualValueDelegate

Returns

ConstraintResult

A ConstraintResult

Type Parameters

TActual

ApplyTo<TActual>(TActual)

Test whether the constraint is satisfied by a given value

public override ConstraintResult ApplyTo<TActual>(TActual actual)

Parameters

actual TActual

The value to be tested

Returns

ConstraintResult

True if no exception is thrown, otherwise false

Type Parameters

TActual