toBeLessThan

fun <T : Comparable<T>> Expect<T>.toBeLessThan(expected: T): Expect<T>(source)

Expects that the subject of this expectation is less than (<) expected. The comparison is carried out with Comparable.compareTo.

Return

an Expect for the subject of this expectation.

Since

0.17.0

Samples

expect(1).toBeLessThan(2)

fails {
    expect(2).toBeLessThan(1)
}

Deprecated

'toBeLessThan' is deprecated in favour of 'toBeBefore' which is based on ChronoZonedDateTime.isBefore instead of compareTo

Replace with

toBeBefore(expected)

Deprecated overload which shall help users to use toBeBefore instead.

Since

1.0.0