kotest-assertions / io.kotest.matchers.date / after

after

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

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

Verifies that two Date occurs in a certain order, checking that one happened after the other. For example, 10/02/1998 is after 09/02/1998, and the matcher will have a positive result for this comparison

    val firstDate = Date(1998, 2, 9)
    val secondDate = Date(1998, 2, 8)

    firstDate shouldBe after(secondDate ) // Assertion passes


    val firstDate = Date(1998, 2, 9)
    val secondDate = Date(1998, 2, 10)

    firstDate shouldNotBe after(secondDate)   // Assertion passes

See Also

Date.shouldBeAfter

Date.shouldNotBeAfter