Class CollectionConstraint
- Namespace
- NUnit.Framework.Constraints
- Assembly
- nunit.framework.dll
CollectionConstraint is the abstract base class for constraints that operate on collections.
public abstract class CollectionConstraint : Constraint, IConstraint, IResolveConstraint
- Inheritance
-
CollectionConstraint
- Implements
- Derived
- Inherited Members
Constructors
CollectionConstraint()
Construct an empty CollectionConstraint
protected CollectionConstraint()
CollectionConstraint(object?)
Construct a CollectionConstraint
protected CollectionConstraint(object? arg)
Parameters
arg
object
Methods
ApplyTo<TActual>(TActual)
Test whether the constraint is satisfied by a given value
public override ConstraintResult ApplyTo<TActual>(TActual actual)
Parameters
actual
TActualThe value to be tested
Returns
- ConstraintResult
True for success, false for failure
Type Parameters
TActual
IsEmpty(IEnumerable)
Determines whether the specified enumerable is empty.
protected static bool IsEmpty(IEnumerable enumerable)
Parameters
enumerable
IEnumerableThe enumerable.
Returns
Matches(IEnumerable)
Protected method to be implemented by derived classes
protected abstract bool Matches(IEnumerable collection)
Parameters
collection
IEnumerable