EnumerableAssertions<TSelf, TEnumerable, T>.OnlyContain Method
Definition
Asserts that all items in the enumerable satisfy the specified predicate.
c#
public AssertionsChain<TSelf, TEnumerable> OnlyContain(Func<T, bool> predicate, string? predicateExpression = null);Parameters
| Name | Type | Description |
|---|---|---|
predicate | Func<T, Boolean> | The predicate that all items must satisfy. |
predicateExpression | String | The expression text of the predicate, captured automatically. |
Returns
AssertionsChain<TSelf, TEnumerable>
An AssertionsChain<TAssertions, T> for chaining further assertions.