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

toBeBeforeOrTheSamePointInTimeAs

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

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

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

Return
an Expect for the subject of this expectation.

Since
0.17.0

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

Expects that the subject of this expectation (a ChronoLocalDate) is before or equal the expected given as String. The expected parameter needs to be in the form of yyyy-mm-dd or else an exception will be thrown.

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

Exceptions

IllegalArgumentException - 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

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

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

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

Return
an Expect for the subject of this expectation.

Since
0.17.0

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

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

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

Return
an Expect for the subject of this expectation.

Since
0.17.0