doc / ch.tutteli.atrium.api.fluent.en_GB / toBeBefore

toBeBefore

fun <T : ChronoLocalDate> Expect<T>.toBeBefore(expected: ChronoLocalDate): Expect<T> (source)

Expects that the subject of this expectation (a ChronoLocalDate) is before the expected.

expect(LocalDate.of(2021, Month.JUNE, 6)).toBeBefore(LocalDate.of(2021, Month.JULY, 1))

Return
an Expect for the subject of this expectation.

Since
0.17.0

fun <T : ChronoLocalDate> Expect<T>.toBeBefore(expected: String): Expect<T> (source)

Expects that the subject of this expectation (a ChronoLocalDate) is before the expected given as String.

expect(LocalDate.of(2021, Month.JUNE, 6)).toBeBefore("2021-07-01")

Exceptions

java.time.DateTimeException - in case expected is not in the form of yyyy-mm-dd

Return
an Expect for the subject of this expectation.

Since
0.17.0

fun <T : ChronoLocalDateTime<out ChronoLocalDate>> Expect<T>.toBeBefore(expected: ChronoLocalDateTime<*>): Expect<T> (source)

Expects that the subject of this expectation (a ChronoLocalDateTime) is before the expected.

expect(LocalDateTime.of(2021, Month.JUNE, 6, 10, 5, 35, 103)).toBeBefore(LocalDateTime.of(2021, Month.JUNE, 6, 12, 10, 0, 0))

Return
an Expect for the subject of this expectation.

Since
0.17.0

fun <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.toBeBefore(expected: ChronoZonedDateTime<*>): Expect<T> (source)

Expects that the subject of this expectation (a ChronoZonedDateTime) is before the expected.

expect(ZonedDateTime.of(2021, 6, 6, 10, 5, 35, 103, ZoneId.of("America/Sao_Paulo")))
    .toBeBefore(ZonedDateTime.of(2021, 6, 6, 12, 10, 0, 0, ZoneId.of("America/Sao_Paulo")))

Return
an Expect for the subject of this expectation.

Since
0.17.0