fun <T> Expect<T>.toBe(expected: T): Expect<T>
(source)
Expects that the subject of this
expectation is (equal to) expected.
expect(12).toBe(12) // holds
fails {
expect(12).toBe(11)
}
// holds, toBe is based on equality, use isSameAs for identity
expect(listOf(1)).toBe(listOf(1))
fails { // because array has not implemented equals, so is equivalent to isSameAs
expect(arrayOf(1)).toBe(arrayOf(1))
}
Return
an Expect for the subject of this
expectation.
@JvmName("toBeNull") fun <T : BigDecimal> Expect<T?>.toBe(expected: Nothing?): Expect<T?>
(source)
Expects that the subject of this
expectation (a BigDecimal) is null
.
// only use toBe to check against null, otherwise use isNumericallyEqualTo or isEqualIncludingScale
expect(null as BigDecimal?).toBe(null)
Return
an Expect for the subject of this
expectation.