doc / ch.tutteli.atrium.api.infix.en_GB / notToBeTheInstance

notToBeTheInstance

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

Expects that the subject of this expectation is not the same instance as expected.

// holds because notToBeTheInstance is based on identity, use notToEqual for equality
expect(listOf(2)) notToBeTheInstance listOf(2)

fails { // because notToBeTheInstance is based on identity, use notToEqual for equality
    val list = listOf(3)
    expect(list) notToBeTheInstance list
}

Return
an Expect for the subject of this expectation.

Since
0.17.0