Table of Contents

Interface IConstraint

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

Interface for all constraints

public interface IConstraint : IResolveConstraint
Inherited Members

Properties

Arguments

Arguments provided to this Constraint, for use in formatting the description.

object[] Arguments { get; }

Property Value

object[]

Builder

The ConstraintBuilder holding this constraint

ConstraintBuilder Builder { get; set; }

Property Value

ConstraintBuilder

Description

The Description of what this constraint tests, for use in messages and in the ConstraintResult.

string Description { get; }

Property Value

string

DisplayName

The display name of this Constraint for use by ToString().

string DisplayName { 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.

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

Parameters

del ActualValueDelegate<TActual>

An ActualValueDelegate

Returns

ConstraintResult

A ConstraintResult

Type Parameters

TActual

ApplyTo<TActual>(TActual)

Applies the constraint to an actual value, returning a ConstraintResult.

ConstraintResult ApplyTo<TActual>(TActual actual)

Parameters

actual TActual

The value to be tested

Returns

ConstraintResult

A ConstraintResult

Type Parameters

TActual

ApplyTo<TActual>(ref TActual)

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.

ConstraintResult ApplyTo<TActual>(ref TActual actual)

Parameters

actual TActual

A reference to the value to be tested

Returns

ConstraintResult

A ConstraintResult

Type Parameters

TActual