kotest-assertions / io.kotest.matchers.date

Package io.kotest.matchers.date

Extensions for External Classes

java.sql.Timestamp

java.time.Instant

java.time.LocalDate

java.time.LocalDateTime

java.time.LocalTime

java.time.OffsetDateTime

java.time.ZonedDateTime

Functions

after

Matcher that compares two Dates and checks whether one is after the other

fun after(other: <ERROR CLASS>): Matcher<<ERROR CLASS>>fun after(anotherInstant: Instant): Matcher<Instant>

Matcher that compares two LocalTimes and checks whether one is after the other

fun after(time: LocalTime): Matcher<LocalTime>

Matcher that compares two LocalDates and checks whether one is after the other

fun after(date: LocalDate): Matcher<LocalDate>

Matcher that compares two LocalDateTimes and checks whether one is after the other

fun after(date: LocalDateTime): Matcher<LocalDateTime>

Matcher that compares two ZonedDateTimes and checks whether one is after the other

fun after(date: ZonedDateTime): Matcher<ZonedDateTime>

Matcher that compares two OffsetDateTimes and checks whether one is after the other

fun after(date: OffsetDateTime): Matcher<OffsetDateTime>

beAfter

fun beAfter(timestamp: Timestamp): Matcher<Timestamp>

beBefore

fun beBefore(timestamp: Timestamp): Matcher<Timestamp>

beBetween

fun beBetween(fromTimestamp: Timestamp, toTimestamp: Timestamp): Matcher<Timestamp>

before

Matcher that compares two Dates and checks whether one is before the other

fun before(date: <ERROR CLASS>): Matcher<<ERROR CLASS>>fun before(anotherInstant: Instant): Matcher<Instant>

Matcher that compares two LocalTimes and checks whether one is before the other

fun before(time: LocalTime): Matcher<LocalTime>

Matcher that compares two LocalDates and checks whether one is before the other

fun before(date: LocalDate): Matcher<LocalDate>

Matcher that compares two LocalDateTimes and checks whether one is before the other

fun before(date: LocalDateTime): Matcher<LocalDateTime>

Matcher that compares two ZonedDateTimes and checks whether one is before the other

fun before(date: ZonedDateTime): Matcher<ZonedDateTime>

Matcher that compares two OffsetDateTimes and checks whether one is before the other

fun before(date: OffsetDateTime): Matcher<OffsetDateTime>

beInToday

Matcher that checks if a LocalDateTime has a Date component of today

fun beInToday(): Matcher<LocalDateTime>

beInTodayODT

fun beInTodayODT(): Matcher<OffsetDateTime>

beInTodayZDT

fun beInTodayZDT(): Matcher<ZonedDateTime>

beToday

Matcher that checks if a LocalDate is today

fun beToday(): Matcher<LocalDate>

between

fun between(fromInstant: Instant, toInstant: Instant): Matcher<Instant>

Matcher that checks if LocalTime is between two other LocalTimes

fun between(a: LocalTime, b: LocalTime): Matcher<LocalTime>

Matcher that checks if LocalDate is between two other LocalDates

fun between(a: LocalDate, b: LocalDate): Matcher<LocalDate>

Matcher that checks if LocalDateTime is between two other LocalDateTimes

fun between(a: LocalDateTime, b: LocalDateTime): Matcher<LocalDateTime>

Matcher that checks if ZonedDateTime is between two other ZonedDateTimes

fun between(a: ZonedDateTime, b: ZonedDateTime): Matcher<ZonedDateTime>

Matcher that checks if OffsetDateTime is between two other OffsetDateTimes

fun between(a: OffsetDateTime, b: OffsetDateTime): Matcher<OffsetDateTime>

haveSameDay

Matcher that compares days of LocalDates

fun haveSameDay(date: LocalDate): Matcher<LocalDate>

Matcher that compares days of LocalDateTimes

fun haveSameDay(date: LocalDateTime): Matcher<LocalDateTime>

Matcher that compares days of ZonedDateTimes

fun haveSameDay(date: ZonedDateTime): Matcher<ZonedDateTime>

Matcher that compares days of OffsetDateTimes

fun haveSameDay(date: OffsetDateTime): Matcher<OffsetDateTime>

haveSameHours

Matcher that compares hours of Dates

fun haveSameHours(other: <ERROR CLASS>): Matcher<<ERROR CLASS>>

Matcher that compares hours of LocalTimes

fun haveSameHours(time: LocalTime): Matcher<LocalTime>

haveSameMinutes

Matcher that compares minutes of LocalTimes

fun haveSameMinutes(time: LocalTime): Matcher<LocalTime>

haveSameMonth

Matcher that compares months of LocalDates

fun haveSameMonth(date: LocalDate): Matcher<LocalDate>

Matcher that compares months of LocalDateTimes

fun haveSameMonth(date: LocalDateTime): Matcher<LocalDateTime>

Matcher that compares months of ZonedDateTimes

fun haveSameMonth(date: ZonedDateTime): Matcher<ZonedDateTime>

Matcher that compares months of OffsetDateTimes

fun haveSameMonth(date: OffsetDateTime): Matcher<OffsetDateTime>

haveSameNanos

Matcher that compares nanos of LocalTimes

fun haveSameNanos(time: LocalTime): Matcher<LocalTime>

haveSameSeconds

Matcher that compares seconds of LocalTimes

fun haveSameSeconds(time: LocalTime): Matcher<LocalTime>

haveSameYear

Matcher that compares years of LocalDates

fun haveSameYear(date: LocalDate): Matcher<LocalDate>

Matcher that compares years of LocalDateTimes

fun haveSameYear(date: LocalDateTime): Matcher<LocalDateTime>

Matcher that compares years of ZonedDateTimes

fun haveSameYear(date: ZonedDateTime): Matcher<ZonedDateTime>

Matcher that compares years of OffsetDateTimes

fun haveSameYear(date: OffsetDateTime): Matcher<OffsetDateTime>

shouldBeAfter

Asserts that this is after other

infix fun <ERROR CLASS>.shouldBeAfter(other: <ERROR CLASS>): <ERROR CLASS>

shouldBeBefore

Asserts that this is before other

infix fun <ERROR CLASS>.shouldBeBefore(other: <ERROR CLASS>): <ERROR CLASS>

shouldHaveDayOfMonth

Asserts that the date has the given day of month 1-31.

infix fun <ERROR CLASS>.shouldHaveDayOfMonth(day: Int): <ERROR CLASS>

shouldHaveDayOfWeek

Asserts that the date has the given day of week 0-6.

infix fun <ERROR CLASS>.shouldHaveDayOfWeek(day: Int): <ERROR CLASS>

shouldHaveHour

Asserts that the hour inputted is equaled the date time hour

infix fun <ERROR CLASS>.shouldHaveHour(hour: Int): <ERROR CLASS>

shouldHaveMinute

Asserts that the minute inputted is equaled the date time minute

infix fun <ERROR CLASS>.shouldHaveMinute(minute: Int): <ERROR CLASS>

shouldHaveMonth

Asserts that the month inputted is equaled the date month

infix fun <ERROR CLASS>.shouldHaveMonth(month: Int): <ERROR CLASS>

shouldHaveSameHoursAs

Asserts that hours in this Date are the same as the given date.

infix fun <ERROR CLASS>.shouldHaveSameHoursAs(other: <ERROR CLASS>): <ERROR CLASS>

shouldHaveSecond

Asserts that the second inputted is equaled the date time second

infix fun <ERROR CLASS>.shouldHaveSecond(second: Int): <ERROR CLASS>

shouldHaveYear

Asserts that the date has the given year.

infix fun <ERROR CLASS>.shouldHaveYear(year: Int): <ERROR CLASS>

shouldNotBeAfter

Asserts that this is NOT after other

infix fun <ERROR CLASS>.shouldNotBeAfter(other: <ERROR CLASS>): <ERROR CLASS>

shouldNotBeBefore

Asserts that this is NOT before other

infix fun <ERROR CLASS>.shouldNotBeBefore(other: <ERROR CLASS>): <ERROR CLASS>

shouldNotHaveSameHoursAs

Asserts that hours in this Date are NOT the same as other's hours

infix fun <ERROR CLASS>.shouldNotHaveSameHoursAs(other: <ERROR CLASS>): <ERROR CLASS>

within

Matcher that compares two LocalDates and checks whether one is within period of the other

fun within(period: Period, date: LocalDate): Matcher<LocalDate>

Matcher that compares two LocalDateTimes and checks whether one is within temporalAmount of the other

fun within(temporalAmount: TemporalAmount, date: LocalDateTime): Matcher<LocalDateTime>

Matcher that compares two ZonedDateTimes and checks whether one is within temporalAmount of the other

fun within(temporalAmount: TemporalAmount, date: ZonedDateTime): Matcher<ZonedDateTime>

Matcher that compares two OffsetDateTimes and checks whether one is within temporalAmount of the other

fun within(temporalAmount: TemporalAmount, date: OffsetDateTime): Matcher<OffsetDateTime>