notToEqual

infix fun <T> Expect<T>.notToEqual(expected: T): Expect<T>(source)

Expects that the subject of this expectation is not (equal to) expected.

Return

an Expect for the subject of this expectation.

Since

0.17.0

Samples

expect(2) notToEqual 3

fails {
    expect(12) notToEqual 12
}

expect(listOf(2)) notToEqual listOf(3)

fails {
    expect(listOf(2)) notToEqual listOf(2)
}
infix fun <T : BigDecimal> Expect<T>.notToEqual(expected: T): Nothing(source)

Deprecated

Use `notToEqualNumerically` if you expect that the following assertion is wrong: `expect(BigDecimal("10")).notToBe(BigDecimal("10.0"))` However, if you expect it to hold (because `BigDecimal.scale` differ), then use `notToEqualIncludingScale`.

Replace with

notToEqualNumerically(expected) or notToEqualIncludingScale(expected)

Deprecated as it would compare the subject against expected including scale -- many developers are not aware of that.

Use isNotNumericallyEqualTo if you expect that the following assertion is wrong:

expect(BigDecimal("10").notToBe(BigDecimal("10.0"))

However, if you expect it to be wrong (because BigDecimal.scale differ), then use notToEqualIncludingScale.

Since

0.17.0