Skip to content

IntegerAssertions<T>.NotEqual Method ​

Definition ​

Asserts that the integer value is not equal to the expected value. Supports comparing integer values of different types.

c#
public new AssertionsChain<IntegerAssertions<T>, T> NotEqual<TOther>(TOther expected)
   where TOther : struct, IBinaryInteger<TOther>;

View source

Type Parameters ​

NameDescription
TOtherThe type of the expected value.

Parameters ​

NameTypeDescription
expectedTOtherThe value that is not expected.

Returns ​

AssertionsChain<IntegerAssertions<T>, T>

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

Remarks ​

If the expected value cannot be represented in type T (for example, comparing a byte with 300), the assertion succeeds because the value cannot equal something that cannot be represented in its type.