Class CollectionConstraint
CollectionConstraint is the abstract base class for constraints that operate on collections.
Inheritance
CollectionConstraint
Inherited Members
Namespace: NUnit.Framework.Constraints
Assembly: nunit.framework.dll
Syntax
public abstract class CollectionConstraint : Constraint, IConstraint, IResolveConstraint
Constructors
View SourceCollectionConstraint()
Construct an empty CollectionConstraint
Declaration
protected CollectionConstraint()
CollectionConstraint(object?)
Construct a CollectionConstraint
Declaration
protected CollectionConstraint(object? arg)
Parameters
Type | Name | Description |
---|---|---|
object | arg |
Methods
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 for success, false for failure |
Type Parameters
Name | Description |
---|---|
TActual |
Overrides
View SourceIsEmpty(IEnumerable)
Determines whether the specified enumerable is empty.
Declaration
protected static bool IsEmpty(IEnumerable enumerable)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable | enumerable | The enumerable. |
Returns
Type | Description |
---|---|
bool | true if the specified enumerable is empty; otherwise, false. |
Matches(IEnumerable)
Protected method to be implemented by derived classes
Declaration
protected abstract bool Matches(IEnumerable collection)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable | collection |
Returns
Type | Description |
---|---|
bool |