Skip to content

EnumerableAssertions<TEnumerable, T>.NotContain Method

Overloads

Name Description
NotContain(T) Asserts that the enumerable does not contain the specified item.
NotContain(T, IEqualityComparer<T>) Asserts that the enumerable does not contain the specified item using the specified equality comparer.
NotContain(T, Func<T, T, Boolean>)

NotContain(T)

Asserts that the enumerable does not contain the specified item.

public EnumerableAssertionsChain<TEnumerable, T> NotContain(T? expected);

Parameters

Name Type Description
expected T The item that should not be present in the enumerable.

Returns

EnumerableAssertionsChain<TEnumerable, T>

An EnumerableAssertionsChain<TEnumerable, T> for chaining further assertions.

NotContain(T, IEqualityComparer<T>)

Asserts that the enumerable does not contain the specified item using the specified equality comparer.

public EnumerableAssertionsChain<TEnumerable, T> NotContain(T? expected, IEqualityComparer<T> comparer);

Parameters

Name Type Description
expected T The item that should not be present in the enumerable.
comparer IEqualityComparer<T> The equality comparer to use for element comparison.

Returns

EnumerableAssertionsChain<TEnumerable, T>

An EnumerableAssertionsChain<TEnumerable, T> for chaining further assertions.

NotContain(T, Func<T, T, Boolean>)

public EnumerableAssertionsChain<TEnumerable, T> NotContain(T? expected, Func<T, T, bool> predicate);

Parameters

Name Type Description
expected T
predicate Func<T, T, Boolean>

Returns

EnumerableAssertionsChain<TEnumerable, T>