fun ZonedDateTime.shouldNotBeBetween(a: ZonedDateTime, b: ZonedDateTime): Unit
Asserts that this is NOT between a and b
Verifies that this is not after a and before b, comparing all fields in ZonedDateTime.
Opposite of ZonedDateTime.shouldBeBetween
val date = ZonedDateTime.of(2019, 2, 15, 12, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
val firstDate = ZonedDateTime.of(2019, 2, 16, 12, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
val secondDate = ZonedDateTime.of(2019, 2, 17, 12, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
date.shouldNotBeBetween(firstDate, secondDate) // Assertion passes
val date = ZonedDateTime.of(2019, 2, 16, 12, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
val firstDate = ZonedDateTime.of(2019, 2, 15, 12, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
val secondDate = ZonedDateTime.of(2019, 2, 17, 12, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
date.shouldNotBeBetween(firstDate, secondDate) // Assertion fails, date IS between firstDate and secondDate
See Also