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

shouldNotHaveSameHoursAs

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

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

Verifies that hours in this time aren't the same as other's hours, ignoring any other fields. For example, 16:59:59:7777 doesn't have the same hours as 16:01:02:0001, and this assertion should pass for this comparison

Opposite of Date.shouldNotHaveSameHoursAs

    val firstTime = LocalTime.of(23, 59, 30, 1000)
    val secondTime = LocalTime.of(20, 59, 30, 1000)

    firstTime shouldNotHaveSameHoursAs secondTime   //  Assertion passes


    val firstTime = LocalTime.of(23, 59, 30, 1000)
    val secondTime = LocalTime.of(23, 30, 25, 2222)

    firstTime shouldNotHaveSameHoursAs secondTime   //  Assertion fails, 23 == 23