Class AllItemsConstraint
AllItemsConstraint applies another constraint to each item in a collection, succeeding if they all succeed.
Inherited Members
Namespace: NUnit.Framework.Constraints
Assembly: nunit.framework.dll
Syntax
public class AllItemsConstraint : PrefixConstraint, IEnumerableConstraint, IConstraint, IResolveConstraint
Constructors
View SourceAllItemsConstraint(IConstraint)
Construct an AllItemsConstraint on top of an existing constraint
Declaration
public AllItemsConstraint(IConstraint itemConstraint)
Parameters
| Type | Name | Description |
|---|---|---|
| IConstraint | itemConstraint |
Properties
View SourceDisplayName
The display name of this Constraint for use by ToString(). The default value is the name of the constraint with trailing "Constraint" removed. Derived classes may set this to another name in their constructors.
Declaration
public override string DisplayName { get; }
Property Value
| Type | Description |
|---|---|
| string |
Overrides
Methods
View SourceApplyToEnumerable<TActual, TItem>(TActual, IEnumerable<TItem>)
Apply the item constraint to each item in the collection, failing if any item fails.
Declaration
public ConstraintResult ApplyToEnumerable<TActual, TItem>(TActual actual, IEnumerable<TItem> enumerable)
Parameters
| Type | Name | Description |
|---|---|---|
| TActual | actual | The value that the collection originated from |
| IEnumerable<TItem> | enumerable | The collection to be tested |
Returns
| Type | Description |
|---|---|
| ConstraintResult | A ConstraintResult |
Type Parameters
| Name | Description |
|---|---|
| TActual | |
| TItem |
ApplyTo<TActual>(TActual)
Apply the item constraint to each item in the collection, failing if any item fails.
Declaration
public override ConstraintResult ApplyTo<TActual>(TActual actual)
Parameters
| Type | Name | Description |
|---|---|---|
| TActual | actual | The value to be tested |
Returns
| Type | Description |
|---|---|
| ConstraintResult | A ConstraintResult |
Type Parameters
| Name | Description |
|---|---|
| TActual |