Skip to content

ObjectAssertions<TSelf, T>.NotEqual Method ​

Overloads ​

NameDescription
NotEqual(T)Asserts that the value is not equal to the expected value using the default equality comparer.
NotEqual(T, IEqualityComparer<T>)Asserts that the value is not equal to the expected value using the specified equality comparer.
NotEqual(T, Func<T, T, Boolean>)

NotEqual(T) ​

Asserts that the value is not equal to the expected value using the default equality comparer.

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

View source

Parameters ​

NameTypeDescription
expectedTThe value that is not expected.

Returns ​

AssertionsChain<TSelf, T>

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

NotEqual(T, IEqualityComparer<T>) ​

Asserts that the value is not equal to the expected value using the specified equality comparer.

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

View source

Parameters ​

NameTypeDescription
expectedTThe value that is not expected.
comparerIEqualityComparer<T>The equality comparer to use for the comparison.

Returns ​

AssertionsChain<TSelf, T>

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

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

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

View source

Parameters ​

NameTypeDescription
expectedT
predicateFunc<T, T, Boolean>

Returns ​

AssertionsChain<TSelf, T>