Table of Contents

Class PredicateConstraint<T>

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

Predicate constraint wraps a Predicate in a constraint, returning success if the predicate is true.

public class PredicateConstraint<T> : Constraint, IConstraint, IResolveConstraint

Type Parameters

T
Inheritance
PredicateConstraint<T>
Implements
Inherited Members

Constructors

PredicateConstraint(Predicate<T>)

Construct a PredicateConstraint from a predicate

public PredicateConstraint(Predicate<T> predicate)

Parameters

predicate Predicate<T>

Properties

Description

Gets text describing a constraint

public override string Description { get; }

Property Value

string

Methods

ApplyTo<TActual>(TActual)

Determines whether the predicate succeeds when applied to the actual value.

public override ConstraintResult ApplyTo<TActual>(TActual actual)

Parameters

actual TActual

Returns

ConstraintResult

Type Parameters

TActual