EnumerableAssertions<TSelf, TEnumerable, T>.Contain Method
Overloads
| Name | Description |
|---|---|
Contain(T) | Asserts that the enumerable contains the specified item. |
Contain(T, IEqualityComparer<T>) | Asserts that the enumerable contains the specified item using the specified equality comparer. |
Contain(T, Func<T, T, Boolean>) |
Contain(T)
Asserts that the enumerable contains the specified item.
c#
public AssertionsChain<TSelf, TEnumerable> Contain(T? expected);Parameters
| Name | Type | Description |
|---|---|---|
expected | T | The item that should be present in the enumerable. |
Returns
AssertionsChain<TSelf, TEnumerable>
An AssertionsChain<TAssertions, T> for chaining further assertions.
Contain(T, IEqualityComparer<T>)
Asserts that the enumerable contains the specified item using the specified equality comparer.
c#
public AssertionsChain<TSelf, TEnumerable> Contain(T? expected, IEqualityComparer<T> comparer);Parameters
| Name | Type | Description |
|---|---|---|
expected | T | The item that should be present in the enumerable. |
comparer | IEqualityComparer<T> | The equality comparer to use for element comparison. |
Returns
AssertionsChain<TSelf, TEnumerable>
An AssertionsChain<TAssertions, T> for chaining further assertions.
Contain(T, Func<T, T, Boolean>)
c#
public AssertionsChain<TSelf, TEnumerable> Contain(T? expected, Func<T, T, bool> predicate);Parameters
| Name | Type | Description |
|---|---|---|
expected | T | |
predicate | Func<T, T, Boolean> |