Skip to content

EnumerableAssertions<TSelf, TEnumerable, T>.NotContain Method ​

Overloads ​

NameDescription
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.

c#
public AssertionsChain<TSelf, TEnumerable> NotContain(T? expected);

View source

Parameters ​

NameTypeDescription
expectedTThe item that should not be present in the enumerable.

Returns ​

AssertionsChain<TSelf, TEnumerable>

An AssertionsChain<TAssertions, T> for chaining further assertions.

NotContain(T, IEqualityComparer<T>) ​

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

c#
public AssertionsChain<TSelf, TEnumerable> NotContain(T? expected, IEqualityComparer<T> comparer);

View source

Parameters ​

NameTypeDescription
expectedTThe item that should not be present in the enumerable.
comparerIEqualityComparer<T>The equality comparer to use for element comparison.

Returns ​

AssertionsChain<TSelf, TEnumerable>

An AssertionsChain<TAssertions, T> for chaining further assertions.

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

c#
public AssertionsChain<TSelf, TEnumerable> NotContain(T? expected, Func<T, T, bool> predicate);

View source

Parameters ​

NameTypeDescription
expectedT
predicateFunc<T, T, Boolean>

Returns ​

AssertionsChain<TSelf, TEnumerable>