public class MatchersKt
| Modifier and Type | Method and Description |
|---|---|
static Matcher<java.time.LocalDate> |
after(java.time.LocalDate date)
Matcher that compares two LocalDates and checks whether one is after the other
|
static Matcher<java.time.LocalDateTime> |
after(java.time.LocalDateTime date)
Matcher that compares two LocalDateTimes and checks whether one is after the other
|
static Matcher<java.time.ZonedDateTime> |
after(java.time.ZonedDateTime date)
Matcher that compares two ZonedDateTimes and checks whether one is after the other
|
static Matcher<java.time.OffsetDateTime> |
after(java.time.OffsetDateTime date)
Matcher that compares two OffsetDateTimes and checks whether one is after the other
|
static Matcher<java.time.LocalDate> |
before(java.time.LocalDate date)
Matcher that compares two LocalDates and checks whether one is before the other
|
static Matcher<java.time.LocalDateTime> |
before(java.time.LocalDateTime date)
Matcher that compares two LocalDateTimes and checks whether one is before the other
|
static Matcher<java.time.ZonedDateTime> |
before(java.time.ZonedDateTime date)
Matcher that compares two ZonedDateTimes and checks whether one is before the other
|
static Matcher<java.time.OffsetDateTime> |
before(java.time.OffsetDateTime date)
Matcher that compares two OffsetDateTimes and checks whether one is before the other
|
static Matcher<java.time.LocalDate> |
between(java.time.LocalDate a,
java.time.LocalDate b)
Matcher that checks if LocalDate is between two other LocalDates
|
static Matcher<java.time.LocalDateTime> |
between(java.time.LocalDateTime a,
java.time.LocalDateTime b)
Matcher that checks if LocalDateTime is between two other LocalDateTimes
|
static Matcher<java.time.ZonedDateTime> |
between(java.time.ZonedDateTime a,
java.time.ZonedDateTime b)
Matcher that checks if ZonedDateTime is between two other ZonedDateTimes
|
static Matcher<java.time.OffsetDateTime> |
between(java.time.OffsetDateTime a,
java.time.OffsetDateTime b)
Matcher that checks if OffsetDateTime is between two other OffsetDateTimes
|
static Matcher<java.time.LocalDate> |
haveSameDay(java.time.LocalDate date)
Matcher that compares days of LocalDates
|
static Matcher<java.time.LocalDateTime> |
haveSameDay(java.time.LocalDateTime date)
Matcher that compares days of LocalDateTimes
|
static Matcher<java.time.ZonedDateTime> |
haveSameDay(java.time.ZonedDateTime date)
Matcher that compares days of ZonedDateTimes
|
static Matcher<java.time.OffsetDateTime> |
haveSameDay(java.time.OffsetDateTime date)
Matcher that compares days of OffsetDateTimes
|
static Matcher<java.time.LocalDate> |
haveSameMonth(java.time.LocalDate date)
Matcher that compares months of LocalDates
|
static Matcher<java.time.LocalDateTime> |
haveSameMonth(java.time.LocalDateTime date)
Matcher that compares months of LocalDateTimes
|
static Matcher<java.time.ZonedDateTime> |
haveSameMonth(java.time.ZonedDateTime date)
Matcher that compares months of ZonedDateTimes
|
static Matcher<java.time.OffsetDateTime> |
haveSameMonth(java.time.OffsetDateTime date)
Matcher that compares months of OffsetDateTimes
|
static Matcher<java.time.LocalDate> |
haveSameYear(java.time.LocalDate date)
Matcher that compares years of LocalDates
|
static Matcher<java.time.LocalDateTime> |
haveSameYear(java.time.LocalDateTime date)
Matcher that compares years of LocalDateTimes
|
static Matcher<java.time.ZonedDateTime> |
haveSameYear(java.time.ZonedDateTime date)
Matcher that compares years of ZonedDateTimes
|
static Matcher<java.time.OffsetDateTime> |
haveSameYear(java.time.OffsetDateTime date)
Matcher that compares years of OffsetDateTimes
|
static void |
shouldBeAfter(java.time.LocalDate $receiver,
java.time.LocalDate date)
Asserts that this is after date
|
static void |
shouldBeAfter(java.time.LocalDateTime $receiver,
java.time.LocalDateTime date)
Asserts that this is after date
|
static void |
shouldBeAfter(java.time.ZonedDateTime $receiver,
java.time.ZonedDateTime date)
Asserts that this is after date
|
static void |
shouldBeAfter(java.time.OffsetDateTime $receiver,
java.time.OffsetDateTime date)
Asserts that this is after date
|
static void |
shouldBeBefore(java.time.LocalDate $receiver,
java.time.LocalDate date)
Asserts that this is before date
|
static void |
shouldBeBefore(java.time.LocalDateTime $receiver,
java.time.LocalDateTime date)
Asserts that this is before date
|
static void |
shouldBeBefore(java.time.ZonedDateTime $receiver,
java.time.ZonedDateTime date)
Asserts that this is before date
|
static void |
shouldBeBefore(java.time.OffsetDateTime $receiver,
java.time.OffsetDateTime date)
Asserts that this is before date
|
static void |
shouldBeBetween(java.time.LocalDate $receiver,
java.time.LocalDate a,
java.time.LocalDate b)
Asserts that this is between a and b
|
static void |
shouldBeBetween(java.time.LocalDateTime $receiver,
java.time.LocalDateTime a,
java.time.LocalDateTime b)
Asserts that this is between a and b
|
static void |
shouldBeBetween(java.time.ZonedDateTime $receiver,
java.time.ZonedDateTime a,
java.time.ZonedDateTime b)
Asserts that this is between a and b
|
static void |
shouldBeBetween(java.time.OffsetDateTime $receiver,
java.time.OffsetDateTime a,
java.time.OffsetDateTime b)
Asserts that this is between a and b
|
static void |
shouldBeWithin(java.time.LocalDate $receiver,
java.time.Period period,
java.time.LocalDate date)
Asserts that this is within period of date
|
static void |
shouldBeWithin(java.time.LocalDateTime $receiver,
java.time.temporal.TemporalAmount temporalAmount,
java.time.LocalDateTime date)
Asserts that this is within temporalAmount of date
|
static void |
shouldBeWithin(java.time.ZonedDateTime $receiver,
java.time.temporal.TemporalAmount temporalAmount,
java.time.ZonedDateTime date)
Asserts that this is within temporalAmount of date
|
static void |
shouldBeWithin(java.time.OffsetDateTime $receiver,
java.time.temporal.TemporalAmount temporalAmount,
java.time.OffsetDateTime date)
Asserts that this is within temporalAmount of date
|
static void |
shouldHaveSameDayAs(java.time.LocalDate $receiver,
java.time.LocalDate date)
Asserts that this day is the same as date's day
|
static void |
shouldHaveSameDayAs(java.time.LocalDateTime $receiver,
java.time.LocalDateTime date)
Asserts that this day is the same as date's day
|
static void |
shouldHaveSameDayAs(java.time.ZonedDateTime $receiver,
java.time.ZonedDateTime date)
Asserts that this day is the same as date's day
|
static void |
shouldHaveSameDayAs(java.time.OffsetDateTime $receiver,
java.time.OffsetDateTime date)
Asserts that this day is the same as date's day
|
static void |
shouldHaveSameMonthAs(java.time.LocalDate $receiver,
java.time.LocalDate date)
Asserts that this month is the same as date's month
|
static void |
shouldHaveSameMonthAs(java.time.LocalDateTime $receiver,
java.time.LocalDateTime date)
Asserts that this month is the same as date's month
|
static void |
shouldHaveSameMonthAs(java.time.ZonedDateTime $receiver,
java.time.ZonedDateTime date)
Asserts that this month is the same as date's month
|
static void |
shouldHaveSameMonthAs(java.time.OffsetDateTime $receiver,
java.time.OffsetDateTime date)
Asserts that this month is the same as date's month
|
static void |
shouldHaveSameYearAs(java.time.LocalDate $receiver,
java.time.LocalDate date)
Asserts that this year is the same as date's year
|
static void |
shouldHaveSameYearAs(java.time.LocalDateTime $receiver,
java.time.LocalDateTime date)
Asserts that this year is the same as date's year
|
static void |
shouldHaveSameYearAs(java.time.ZonedDateTime $receiver,
java.time.ZonedDateTime date)
Asserts that this year is the same as date's year
|
static void |
shouldHaveSameYearAs(java.time.OffsetDateTime $receiver,
java.time.OffsetDateTime date)
Asserts that this year is the same as date's year
|
static void |
shouldNotBeAfter(java.time.LocalDate $receiver,
java.time.LocalDate date)
Asserts that this is NOT after date
|
static void |
shouldNotBeAfter(java.time.LocalDateTime $receiver,
java.time.LocalDateTime date)
Asserts that this is NOT after date
|
static void |
shouldNotBeAfter(java.time.ZonedDateTime $receiver,
java.time.ZonedDateTime date)
Asserts that this is NOT after date
|
static void |
shouldNotBeAfter(java.time.OffsetDateTime $receiver,
java.time.OffsetDateTime date)
Asserts that this is NOT after date
|
static void |
shouldNotBeBefore(java.time.LocalDate $receiver,
java.time.LocalDate date)
Asserts that this is NOT before date
|
static void |
shouldNotBeBefore(java.time.LocalDateTime $receiver,
java.time.LocalDateTime date)
Asserts that this is NOT before date
|
static void |
shouldNotBeBefore(java.time.ZonedDateTime $receiver,
java.time.ZonedDateTime date)
Asserts that this is NOT before date
|
static void |
shouldNotBeBefore(java.time.OffsetDateTime $receiver,
java.time.OffsetDateTime date)
Asserts that this is NOT before date
|
static void |
shouldNotBeBetween(java.time.LocalDate $receiver,
java.time.LocalDate a,
java.time.LocalDate b)
Asserts that this is NOT between a and b
|
static void |
shouldNotBeBetween(java.time.LocalDateTime $receiver,
java.time.LocalDateTime a,
java.time.LocalDateTime b)
Asserts that this is NOT between a and b
|
static void |
shouldNotBeBetween(java.time.ZonedDateTime $receiver,
java.time.ZonedDateTime a,
java.time.ZonedDateTime b)
Asserts that this is NOT between a and b
|
static void |
shouldNotBeBetween(java.time.OffsetDateTime $receiver,
java.time.OffsetDateTime a,
java.time.OffsetDateTime b)
Asserts that this is NOT between a and b
|
static void |
shouldNotBeWithin(java.time.LocalDate $receiver,
java.time.Period period,
java.time.LocalDate date)
Asserts that this is NOT within period of date
|
static void |
shouldNotBeWithin(java.time.LocalDateTime $receiver,
java.time.temporal.TemporalAmount temporalAmount,
java.time.LocalDateTime date)
Asserts that this is NOT within temporalAmount of date
|
static void |
shouldNotBeWithin(java.time.ZonedDateTime $receiver,
java.time.temporal.TemporalAmount temporalAmount,
java.time.ZonedDateTime date)
Asserts that this is NOT within temporalAmount of date
|
static void |
shouldNotBeWithin(java.time.OffsetDateTime $receiver,
java.time.temporal.TemporalAmount temporalAmount,
java.time.OffsetDateTime date)
Asserts that this is NOT within temporalAmount of date
|
static void |
shouldNotHaveSameDayAs(java.time.LocalDate $receiver,
java.time.LocalDate date)
Asserts that this day is NOT the same as date's day
|
static void |
shouldNotHaveSameDayAs(java.time.LocalDateTime $receiver,
java.time.LocalDateTime date)
Asserts that this day is NOT the same as date's day
|
static void |
shouldNotHaveSameDayAs(java.time.ZonedDateTime $receiver,
java.time.ZonedDateTime date)
Asserts that this day is NOT the same as date's day
|
static void |
shouldNotHaveSameDayAs(java.time.OffsetDateTime $receiver,
java.time.OffsetDateTime date)
Asserts that this day is NOT the same as date's day
|
static void |
shouldNotHaveSameMonthAs(java.time.LocalDate $receiver,
java.time.LocalDate date)
Asserts that this month is NOT the same as date's month
|
static void |
shouldNotHaveSameMonthAs(java.time.LocalDateTime $receiver,
java.time.LocalDateTime date)
Asserts that this month is NOT the same as date's month
|
static void |
shouldNotHaveSameMonthAs(java.time.ZonedDateTime $receiver,
java.time.ZonedDateTime date)
Asserts that this month is NOT the same as date's month
|
static void |
shouldNotHaveSameMonthAs(java.time.OffsetDateTime $receiver,
java.time.OffsetDateTime date)
Asserts that this month is NOT the same as date's month
|
static void |
shouldNotHaveSameYearAs(java.time.LocalDate $receiver,
java.time.LocalDate date)
Asserts that this year is NOT the same as date's year
|
static void |
shouldNotHaveSameYearAs(java.time.LocalDateTime $receiver,
java.time.LocalDateTime date)
Asserts that this year is NOT the same as date's year
|
static void |
shouldNotHaveSameYearAs(java.time.ZonedDateTime $receiver,
java.time.ZonedDateTime date)
Asserts that this year is NOT the same as date's year
|
static void |
shouldNotHaveSameYearAs(java.time.OffsetDateTime $receiver,
java.time.OffsetDateTime date)
Asserts that this year is NOT the same as date's year
|
static Matcher<java.time.LocalDate> |
within(java.time.Period period,
java.time.LocalDate date)
Matcher that compares two LocalDates and checks whether one is within period of the other
|
static Matcher<java.time.LocalDateTime> |
within(java.time.temporal.TemporalAmount temporalAmount,
java.time.LocalDateTime date)
Matcher that compares two LocalDateTimes and checks whether one is within temporalAmount of the other
|
static Matcher<java.time.ZonedDateTime> |
within(java.time.temporal.TemporalAmount temporalAmount,
java.time.ZonedDateTime date)
Matcher that compares two ZonedDateTimes and checks whether one is within temporalAmount of the other
|
static Matcher<java.time.OffsetDateTime> |
within(java.time.temporal.TemporalAmount temporalAmount,
java.time.OffsetDateTime date)
Matcher that compares two OffsetDateTimes and checks whether one is within temporalAmount of the other
|
public static void shouldHaveSameYearAs(java.time.LocalDate $receiver,
java.time.LocalDate date)
Asserts that this year is the same as date's year
Verifies that this year is the same as date's year, ignoring any other fields. For example, 09/02/1998 has the same year as 10/03/1998, and this assertion should pass for this comparison
Opposite of MatchersKt.shouldNotHaveSameYearAs
val firstDate = LocalDate.of(1998, 2, 9)
val secondDate = LocalDate.of(1998, 3, 10)
firstDate shouldHaveSameYearAs secondDate // Assertion passes
val firstDate = LocalDate.of(2018, 2, 9)
val secondDate = LocalDate.of(1998, 2, 9)
firstDate shouldHaveSameYearAs secondDate // Assertion fails, 2018 != 1998
MatchersKt.shouldNotHaveSameYearAspublic static void shouldNotHaveSameYearAs(java.time.LocalDate $receiver,
java.time.LocalDate date)
Asserts that this year is NOT the same as date's year
Verifies that this year isn't the same as date's year, ignoring any other fields. For example, 09/02/1998 doesn't have the same year as 09/02/2018, and this assertion should pass for this comparison
Opposite of MatchersKt.shouldHaveSameYearAs
val firstDate = LocalDate.of(2018, 2, 9)
val secondDate = LocalDate.of(1998, 2, 9)
firstDate shouldNotHaveSameYearAs secondDate // Assertion passes
val firstDate = LocalDate.of(1998, 2, 9)
val secondDate = LocalDate.of(1998, 3, 10)
firstDate shouldNotHaveSameYearAs secondDate // Assertion fails, 1998 == 1998, and we expected a difference
MatchersKt.shouldHaveSameYearAspublic static Matcher<java.time.LocalDate> haveSameYear(java.time.LocalDate date)
Matcher that compares years of LocalDates
Verifies that two dates have exactly the same year, ignoring any other fields. For example, 09/02/1998 has the same year as 10/03/1998, and the matcher will have a positive result for this comparison
val firstDate = LocalDate.of(1998, 2, 9)
val secondDate = LocalDate.of(1998, 3, 10)
firstDate should haveSameYear(secondDate) // Assertion passes
val firstDate = LocalDate.of(1998, 2, 9)
val secondDate = LocalDate.of(2018, 2, 9)
firstDate shouldNot haveSameYear(secondDate) // Assertion passes
public static void shouldHaveSameYearAs(java.time.LocalDateTime $receiver,
java.time.LocalDateTime date)
Asserts that this year is the same as date's year
Verifies that this year is the same as date's year, ignoring any other fields. For example, 09/02/1998 10:00:00 has the same year as 10/03/1998 11:30:30, and this assertion should pass for this comparison
Opposite of MatchersKt.shouldNotHaveSameYearAs
val firstDate = LocalDateTime.of(1998, 2, 9, 10, 0, 0)
val secondDate = LocalDateTime.of(1998, 3, 10, 11, 30, 30)
firstDate shouldHaveSameYearAs secondDate // Assertion passes
val firstDate = LocalDateTime.of(2018, 2, 9, 10, 0, 0)
val secondDate = LocalDateTime.of(1998, 2, 9, 10, 0, 0)
firstDate shouldHaveSameYearAs secondDate // Assertion fails, 2018 != 1998
MatchersKt.shouldNotHaveSameYearAspublic static void shouldNotHaveSameYearAs(java.time.LocalDateTime $receiver,
java.time.LocalDateTime date)
Asserts that this year is NOT the same as date's year
Verifies that this year isn't the same as date's year, ignoring any other fields. For example, 09/02/1998 10:00:00 doesn't have the same year as 09/02/2018 10:00:00, and this assertion should pass for this comparison
Opposite of MatchersKt.shouldHaveSameYearAs
val firstDate = LocalDateTime.of(2018, 2, 9, 10, 0, 0)
val secondDate = LocalDateTime.of(1998, 3, 10, 11, 30, 30)
firstDate shouldNotHaveSameYearAs secondDate // Assertion passes
val firstDate = LocalDateTime.of(1998, 2, 9, 10, 0, 0)
val secondDate = LocalDateTime.of(1998, 3, 10, 1, 30, 30)
firstDate shouldNotHaveSameYearAs secondDate // Assertion fails, 1998 == 1998, and we expected a difference
MatchersKt.shouldHaveSameYearAspublic static Matcher<java.time.LocalDateTime> haveSameYear(java.time.LocalDateTime date)
Matcher that compares years of LocalDateTimes
Verifies that two DateTimes have exactly the same year, ignoring any other fields. For example, 09/02/1998 10:00:00 has the same year as 10/03/1998 11:30:30, and the matcher will have a positive result for this comparison
val firstDate = LocalDateTime.of(1998, 2, 9, 10, 0, 0)
val secondDate = LocalDateTime.of(1998, 3, 10, 11, 30, 30)
firstDate should haveSameYear(secondDate) // Assertion passes
val firstDate = LocalDateTime.of(1998, 2, 9, 10, 0, 0)
val secondDate = LocalDateTime.of(2018, 2, 9, 10, 0, 0)
firstDate shouldNot haveSameYear(secondDate) // Assertion passes
public static void shouldHaveSameYearAs(java.time.ZonedDateTime $receiver,
java.time.ZonedDateTime date)
Asserts that this year is the same as date's year
Verifies that this year is the same as date's year, ignoring any other fields. For example, 09/02/1998 10:00:00 -03:00 America/Sao_Paulo has the same year as 10/03/1998 11:30:30 -05:00 America/Chicago, and this assertion should pass for this comparison
Opposite of MatchersKt.shouldNotHaveSameYearAs
val firstDate = ZonedDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
val secondDate = ZonedDateTime.of(1998, 3, 10, 11, 30, 30, 30, ZoneId.of("America/Chicago"))
firstDate shouldHaveSameYearAs secondDate // Assertion passes
val firstDate = ZonedDateTime.of(2018, 2, 9, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
val secondDate = ZonedDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
firstDate shouldHaveSameYearAs secondDate // Assertion fails, 2018 != 1998
MatchersKt.shouldNotHaveSameYearAspublic static void shouldNotHaveSameYearAs(java.time.ZonedDateTime $receiver,
java.time.ZonedDateTime date)
Asserts that this year is NOT the same as date's year
Verifies that this year isn't the same as date's year, ignoring any other fields. For example, 09/02/1998 10:00:00 -03:00 America/Sao_Paulo doesn't have the same year as 09/02/2018 10:00:00 -03:00 America/Sao_Paulo, and this assertion should pass for this comparison
Opposite of MatchersKt.shouldHaveSameYearAs
val firstDate = ZonedDateTime.of(2018, 2, 9, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
val secondDate = ZonedDateTime.of(1998, 2, 9, 19, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
firstDate shouldNotHaveSameYearAs secondDate // Assertion passes
val firstDate = ZonedDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
val secondDate = ZonedDateTime.of(1998, 3, 10, 1, 30, 30, 30, ZoneId.of("America/Chicago"))
firstDate shouldNotHaveSameYearAs secondDate // Assertion fails, 1998 == 1998, and we expected a difference
MatchersKt.shouldHaveSameYearAspublic static Matcher<java.time.ZonedDateTime> haveSameYear(java.time.ZonedDateTime date)
Matcher that compares years of ZonedDateTimes
Verifies that two ZonedDateTimes have exactly the same year, ignoring any other fields. For example, 09/02/1998 10:00:00 -03:00 America/Sao_Paulo has the same year as 10/03/1998 11:30:30 -05:00 America/Chicago, and the matcher will have a positive result for this comparison
val firstDate = ZonedDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
val secondDate = ZonedDateTime.of(1998, 3, 10, 11, 30, 30, 30, ZoneId.of("America/Chicago"))
firstDate should haveSameYear(secondDate) // Assertion passes
val firstDate = ZonedDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
val secondDate = ZonedDateTime.of(2018, 2, 9, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
firstDate shouldNot haveSameYear(secondDate) // Assertion passes
public static void shouldHaveSameYearAs(java.time.OffsetDateTime $receiver,
java.time.OffsetDateTime date)
Asserts that this year is the same as date's year
Verifies that this year is the same as date's year, ignoring any other fields. For example, 09/02/1998 10:00:00 -03:00 has the same year as 10/03/1998 11:30:30 -05:00, and this assertion should pass for this comparison
Opposite of MatchersKt.shouldNotHaveSameYearAs
val firstDate = OffsetDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(1998, 3, 10, 11, 30, 30, 30, ZoneOffset.ofHours(-5))
firstDate shouldHaveSameYearAs secondDate // Assertion passes
val firstDate = OffsetDateTime.of(2018, 2, 9, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
firstDate shouldHaveSameYearAs secondDate // Assertion fails, 2018 != 1998
MatchersKt.shouldNotHaveSameYearAspublic static void shouldNotHaveSameYearAs(java.time.OffsetDateTime $receiver,
java.time.OffsetDateTime date)
Asserts that this year is NOT the same as date's year
Verifies that this year isn't the same as date's year, ignoring any other fields. For example, 09/02/1998 10:00:00 -03:00 doesn't have the same year as 09/02/2018 10:00:00 -03:00, and this assertion should pass for this comparison
Opposite of MatchersKt.shouldHaveSameYearAs
val firstDate = OffsetDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(1999, 2, 9, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
firstDate shouldNotHaveSameYearAs secondDate // Assertion passes
val firstDate = OffsetDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(1998, 3, 10, 11, 30, 30, 0, ZoneOffset.ofHours(-3))
firstDate shouldNotHaveSameYearAs secondDate // Assertion fails, 1998 == 1998 and we expected a difference
MatchersKt.shouldHaveSameYearAspublic static Matcher<java.time.OffsetDateTime> haveSameYear(java.time.OffsetDateTime date)
Matcher that compares years of OffsetDateTimes
Verifies that two ZonedDateTimes have exactly the same year, ignoring any other fields. For example, 09/02/1998 10:00:00 -03:00 has the same year as 10/03/1998 11:30:30 -05:00, and the matcher will have a positive result for this comparison
val firstDate = OffsetDateTime.of(2018, 2, 9, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(1998, 2, 9, 19, 0, 0, 0, ZoneOffset.ofHours(-3))
firstDate shouldNotHaveSameYearAs secondDate // Assertion passes
val firstDate = OffsetDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(1998, 3, 10, 1, 30, 30, 30, ZoneOffset.ofHours(-5))
firstDate shouldNotHaveSameYearAs secondDate // Assertion fails, 1998 == 1998, and we expected a difference
public static void shouldHaveSameMonthAs(java.time.LocalDate $receiver,
java.time.LocalDate date)
Asserts that this month is the same as date's month
Verifies that month year is the same as date's month, ignoring any other fields. For example, 09/02/1998 has the same month as 10/02/2018, and this assertion should pass for this comparison
Opposite of MatchersKt.shouldNotHaveSameMonthAs
val firstDate = LocalDate.of(1998, 2, 9)
val secondDate = LocalDate.of(1998, 3, 10)
firstDate should haveSameYear(secondDate) // Assertion passes
val firstDate = LocalDate.of(1998, 2, 9)
val secondDate = LocalDate.of(2018, 2, 9)
firstDate shouldNot haveSameYear(secondDate) // Assertion passes
MatchersKt.shouldNotHaveSameMonthAspublic static void shouldNotHaveSameMonthAs(java.time.LocalDate $receiver,
java.time.LocalDate date)
Asserts that this month is NOT the same as date's month
Verifies that this month isn't the same as date's month, ignoring any other fields. For example, 09/02/1998 doesn't have the same month as 09/03/1998, and this assertion should pass for this comparison
Opposite of MatchersKt.shouldHaveSameMonthAs
val firstDate = LocalDate.of(1998, 2, 9)
val secondDate = LocalDate.of(2018, 2, 10)
firstDate shouldHaveSameMonthAs secondDate // Assertion passes
val firstDate = LocalDate.of(1998, 2, 9)
val secondDate = LocalDate.of(1998, 3, 9)
firstDate shouldHaveSameMonthAs secondDate // Assertion fails, 2 != 3
MatchersKt.shouldHaveSameMonthAspublic static Matcher<java.time.LocalDate> haveSameMonth(java.time.LocalDate date)
Matcher that compares months of LocalDates
Verifies that two dates have exactly the same month, ignoring any other fields. For example, 09/02/1998 has the same month as 10/02/2018, and the matcher will have a positive result for this comparison
val firstDate = LocalDate.of(1998, 2, 9)
val secondDate = LocalDate.of(1998, 3, 9)
firstDate shouldNotHaveSameMonthAs secondDate // Assertion passes
val firstDate = LocalDate.of(1998, 2, 9)
val secondDate = LocalDate.of(2018, 2, 10)
firstDate shouldNotHaveSameMonthAs secondDate // Assertion fails, 2 == 2, and we expected a difference
public static void shouldHaveSameMonthAs(java.time.LocalDateTime $receiver,
java.time.LocalDateTime date)
Asserts that this month is the same as date's month
Verifies that this month is the same as date's month, ignoring any other fields. For example, 09/02/1998 10:00:00 has the same month as 10/02/2018 11:30:30, and this assertion should pass for this comparison
Opposite of MatchersKt.shouldNotHaveSameMonthAs
val firstDate = LocalDateTime.of(1998, 2, 9, 10, 0, 0)
val secondDate = LocalDateTime.of(2018, 2, 10, 10, 0, 0)
firstDate should haveSameMonth(secondDate) // Assertion passes
val firstDate = LocalDateTime.of(1998, 2, 9, 10, 0, 0)
val secondDate = LocalDateTime.of(1998, 3, 9, 10, 0, 0)
firstDate shouldNot haveSameMonth(secondDate) // Assertion passes
MatchersKt.shouldNotHaveSameMonthAspublic static void shouldNotHaveSameMonthAs(java.time.LocalDateTime $receiver,
java.time.LocalDateTime date)
Asserts that this month is NOT the same as date's month
Verifies that this month isn't the same as date's month, ignoring any other fields. For example, 09/02/1998 10:00:00 doesn't have the same month as 09/03/1998 10:00:00, and this assertion should pass for this comparison
Opposite of MatchersKt.shouldHaveSameMonthAs
val firstDate = LocalDateTime.of(1998, 2, 9, 10, 0, 0)
val secondDate = LocalDateTime.of(2018, 2, 10, 11, 30, 30)
firstDate shouldHaveSameMonthAs secondDate // Assertion passes
val firstDate = LocalDateTime.of(1998, 2, 9, 10, 0, 0)
val secondDate = LocalDateTime.of(1998, 3, 9, 10, 0, 0)
firstDate shouldHaveSameMonthAs secondDate // Assertion fails, 2 != 3
MatchersKt.shouldHaveSameMonthAspublic static Matcher<java.time.LocalDateTime> haveSameMonth(java.time.LocalDateTime date)
Matcher that compares months of LocalDateTimes
Verifies that two DateTimes have exactly the same month, ignoring any other fields. For example, 09/02/1998 10:00:00 has the same month as 10/02/2018 11:30:30, and the matcher will have a positive result for this comparison
val firstDate = LocalDateTime.of(1998, 2, 9, 10, 0, 0)
val secondDate = LocalDateTime.of(1998, 3, 10, 11, 30, 30)
firstDate shouldNotHaveSameMonthAs secondDate // Assertion passes
val firstDate = LocalDateTime.of(2018, 2, 9, 10, 0, 0)
val secondDate = LocalDateTime.of(1998, 2, 10, 1, 30, 30)
firstDate shouldNotHaveSameMonthAs secondDate // Assertion fails, 2 == 2, and we expected a difference
public static void shouldHaveSameMonthAs(java.time.ZonedDateTime $receiver,
java.time.ZonedDateTime date)
Asserts that this month is the same as date's month
Verifies that this month is the same as date's month, ignoring any other fields. For example, 09/02/1998 10:00:00 -03:00 America/Sao_Paulo has the same month as 10/02/2018 11:30:30 -05:00 America/Chicago, and this assertion should pass for this comparison
Opposite of MatchersKt.shouldNotHaveSameMonthAs
val firstDate = ZonedDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
val secondDate = ZonedDateTime.of(2018, 2, 10, 11, 30, 30, 0, ZoneId.of("America/Sao_Paulo"))
firstDate should haveSameMonth(secondDate) // Assertion passes
val firstDate = ZonedDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
val secondDate = ZonedDateTime.of(1998, 3, 9, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
firstDate shouldNot haveSameMonth(secondDate) // Assertion passes
MatchersKt.shouldNotHaveSameMonthAspublic static void shouldNotHaveSameMonthAs(java.time.ZonedDateTime $receiver,
java.time.ZonedDateTime date)
Asserts that this month is NOT the same as date's month
Verifies that this month isn't the same as date's month, ignoring any other fields. For example, 09/02/1998 10:00:00 -03:00 America/Sao_Paulo doesn't have the same month as 09/03/1998 10:00:00 -03:00 America/Sao_Paulo, and this assertion should pass for this comparison
Opposite of MatchersKt.shouldHaveSameMonthAs
val firstDate = ZonedDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
val secondDate = ZonedDateTime.of(2018, 2, 10, 11, 30, 30, 30, ZoneId.of("America/Chicago"))
firstDate shouldHaveSameMonthAs secondDate // Assertion passes
val firstDate = ZonedDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
val secondDate = ZonedDateTime.of(1998, 3, 9, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
firstDate shouldHaveSameMonthAs secondDate // Assertion fails, 2 != 3
MatchersKt.shouldHaveSameMonthAspublic static Matcher<java.time.ZonedDateTime> haveSameMonth(java.time.ZonedDateTime date)
Matcher that compares months of ZonedDateTimes
Verifies that two ZonedDateTimes have exactly the same month, ignoring any other fields. For example, 09/02/1998 10:00:00 -03:00 America/Sao_Paulo has the same month as 10/02/2018 11:30:30 -05:00 America/Chicago, and the matcher will have a positive result for this comparison
val firstDate = ZonedDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
val secondDate = ZonedDateTime.of(1998, 3, 9, 19, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
firstDate shouldNotHaveSameMonthAs secondDate // Assertion passes
val firstDate = ZonedDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
val secondDate = ZonedDateTime.of(2018, 2, 10, 1, 30, 30, 30, ZoneId.of("America/Chicago"))
firstDate shouldNotHaveSameMonthAs secondDate // Assertion fails, 2 == 2, and we expected a difference
public static void shouldHaveSameMonthAs(java.time.OffsetDateTime $receiver,
java.time.OffsetDateTime date)
Asserts that this month is the same as date's month
Verifies that this month is the same as date's month, ignoring any other fields. For example, 09/02/1998 10:00:00 -03:00 has the same month as 10/02/2018 11:30:30 -05:00, and this assertion should pass for this comparison
Opposite of MatchersKt.shouldNotHaveSameMonthAs
val firstDate = OffsetDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(2018, 2, 10, 11, 30, 30, 30, ZoneOffset.ofHours(-5))
firstDate shouldHaveSameMonthAs secondDate // Assertion passes
val firstDate = OffsetDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(1998, 3, 9, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
firstDate shouldHaveSameMonthAs secondDate // Assertion fails, 2 != 3
MatchersKt.shouldNotHaveSameMonthAspublic static void shouldNotHaveSameMonthAs(java.time.OffsetDateTime $receiver,
java.time.OffsetDateTime date)
Asserts that this month is NOT the same as date's month
Verifies that this month isn't the same as date's month, ignoring any other fields. For example, 09/02/1998 10:00:00 -03:00 doesn't have the same month as 09/03/1998 10:00:00 -03:00, and this assertion should pass for this comparison
Opposite of MatchersKt.shouldHaveSameMonthAs
val firstDate = OffsetDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(1998, 3, 9, 19, 0, 0, 0, ZoneOffset.ofHours(-3))
firstDate shouldNotHaveSameMonthAs secondDate // Assertion passes
val firstDate = OffsetDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(2018, 2, 10, 1, 30, 30, 30, ZoneOffset.ofHours(-5))
firstDate shouldNotHaveSameMonthAs secondDate // Assertion fails, 2 == 2, and we expected a difference
MatchersKt.shouldHaveSameMonthAspublic static Matcher<java.time.OffsetDateTime> haveSameMonth(java.time.OffsetDateTime date)
Matcher that compares months of OffsetDateTimes
Verifies that two ZonedDateTimes have exactly the same month, ignoring any other fields. For example, 09/02/1998 10:00:00 -03:00 has the same month as 10/02/1998 11:30:30 -05:00, and the matcher will have a positive result for this comparison
val firstDate = OffsetDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(2018, 2, 10, 11, 30, 30, 30, ZoneOffset.ofHours(-5))
firstDate should haveSameMonth(secondDate) // Assertion passes
val firstDate = OffsetDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(1998, 3, 9, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
firstDate shouldNot haveSameMonth(secondDate) // Assertion passes
public static void shouldHaveSameDayAs(java.time.LocalDate $receiver,
java.time.LocalDate date)
Asserts that this day is the same as date's day
Verifies that this day is the same as date's day, ignoring any other fields. For example, 09/02/1998 has the same day as 09/03/2018, and this assertion should pass for this comparison
Opposite of MatchersKt.shouldNotHaveSameDayAs
val firstDate = LocalDate.of(1998, 2, 9)
val secondDate = LocalDate.of(2018, 3, 9)
firstDate shouldHaveSameDayAs secondDate // Assertion passes
val firstDate = LocalDate.of(1998, 2, 9)
val secondDate = LocalDate.of(1998, 2, 10)
firstDate shouldHaveSameDayAs secondDate // Assertion fails, 9 != 10
MatchersKt.shouldNotHaveSameDayAspublic static void shouldNotHaveSameDayAs(java.time.LocalDate $receiver,
java.time.LocalDate date)
Asserts that this day is NOT the same as date's day
Verifies that this day isn't the same as date's day, ignoring any other fields. For example, 09/02/1998 doesn't have the same day as 10/02/1998, and this assertion should pass for this comparison
Opposite of MatchersKt.shouldHaveSameDayAs
val firstDate = LocalDate.of(1998, 2, 9)
val secondDate = LocalDate.of(1998, 2, 10)
firstDate shouldNotHaveSameDayAs secondDate // Assertion passes
val firstDate = LocalDate.of(1998, 2, 9)
val secondDate = LocalDate.of(2018, 3, 9)
firstDate shouldNotHaveSameDayAs secondDate // Assertion fails, 9 == 9, and we expected a difference
MatchersKt.shouldHaveSameDayAspublic static Matcher<java.time.LocalDate> haveSameDay(java.time.LocalDate date)
Matcher that compares days of LocalDates
Verifies that two dates have exactly the same day, ignoring any other fields. For example, 09/02/1998 has the same day as 09/03/2018, and the matcher will have a positive result for this comparison
val firstDate = LocalDate.of(1998, 2, 9)
val secondDate = LocalDate.of(2018, 3, 9)
firstDate should haveSameDay(secondDate) // Assertion passes
val firstDate = LocalDate.of(1998, 2, 9)
val secondDate = LocalDate.of(1998, 2, 10)
firstDate shouldNot haveSameDay(secondDate) // Assertion passes
public static void shouldHaveSameDayAs(java.time.LocalDateTime $receiver,
java.time.LocalDateTime date)
Asserts that this day is the same as date's day
Verifies that this day is the same as date's day, ignoring any other fields. For example, 09/02/1998 10:00:00 has the same day as 09/03/2018 11:30:30, and this assertion should pass for this comparison
Opposite of MatchersKt.shouldNotHaveSameDayAs
val firstDate = LocalDateTime.of(1998, 2, 9, 10, 0, 0)
val secondDate = LocalDateTime.of(1998, 3, 9, 11, 30, 30)
firstDate shouldHaveSameDayAs secondDate // Assertion passes
val firstDate = LocalDateTime.of(1998, 2, 9, 10, 0, 0)
val secondDate = LocalDateTime.of(1998, 2, 10, 10, 0, 0)
firstDate shouldHaveSameDayAs secondDate // Assertion fails, 9 != 10
MatchersKt.shouldNotHaveSameDayAspublic static void shouldNotHaveSameDayAs(java.time.LocalDateTime $receiver,
java.time.LocalDateTime date)
Asserts that this day is NOT the same as date's day
Verifies that this year isn't the same as date's day, ignoring any other fields. For example, 09/02/1998 10:00:00 doesn't have the same day as 10/02/1998 10:00:00, and this assertion should pass for this comparison
Opposite of MatchersKt.shouldHaveSameDayAs
val firstDate = LocalDateTime.of(1998, 2, 9, 10, 0, 0)
val secondDate = LocalDateTime.of(1998, 2, 10, 10, 0, 0)
firstDate shouldNotHaveSameDayAs secondDate // Assertion passes
val firstDate = LocalDateTime.of(2018, 2, 9, 10, 0, 0)
val secondDate = LocalDateTime.of(1998, 3, 9, 11, 30, 30)
firstDate shouldNotHaveSameDayAs secondDate // Assertion fails, 9 == 9, and we expected a difference
MatchersKt.shouldHaveSameDayAspublic static Matcher<java.time.LocalDateTime> haveSameDay(java.time.LocalDateTime date)
Matcher that compares days of LocalDateTimes
Verifies that two DateTimes have exactly the same day, ignoring any other fields. For example, 09/02/1998 10:00:00 has the same day as 09/03/2018 11:30:30, and the matcher will have a positive result for this comparison
val firstDate = LocalDateTime.of(1998, 2, 9, 10, 0, 0)
val secondDate = LocalDateTime.of(2018, 3, 9, 11, 30, 30)
firstDate should haveSameDay(secondDate) // Assertion passes
val firstDate = LocalDateTime.of(1998, 2, 9, 10, 0, 0)
val secondDate = LocalDateTime.of(1998, 2, 10, 10, 0, 0)
firstDate shouldNot haveSameDay(secondDate) // Assertion passes
public static void shouldHaveSameDayAs(java.time.ZonedDateTime $receiver,
java.time.ZonedDateTime date)
Asserts that this day is the same as date's day
Verifies that this day is the same as date's day, ignoring any other fields. For example, 09/02/1998 10:00:00 -03:00 America/Sao_Paulo has the same day as 09/03/2018 11:30:30 -05:00 America/Chicago, and this assertion should pass for this comparison
Opposite of MatchersKt.shouldNotHaveSameDayAs
val firstDate = ZonedDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
val secondDate = ZonedDateTime.of(2018, 3, 9, 11, 30, 30, 30, ZoneId.of("America/Chicago"))
firstDate shouldHaveSameDayAs secondDate // Assertion passes
val firstDate = ZonedDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
val secondDate = ZonedDateTime.of(1998, 2, 10, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
firstDate shouldHaveSameDayAs secondDate // Assertion fails, 9 != 10
MatchersKt.shouldNotHaveSameDayAspublic static void shouldNotHaveSameDayAs(java.time.ZonedDateTime $receiver,
java.time.ZonedDateTime date)
Asserts that this day is NOT the same as date's day
Verifies that this day isn't the same as date's day, ignoring any other fields. For example, 09/02/1998 10:00:00 -03:00 America/Sao_Paulo doesn't have the same day as 10/02/1998 10:00:00 -03:00 America/Sao_Paulo, and this assertion should pass for this comparison
Opposite of MatchersKt.shouldHaveSameDayAs
val firstDate = ZonedDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
val secondDate = ZonedDateTime.of(1998, 2, 10, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
firstDate shouldNotHaveSameDayAs secondDate // Assertion passes
val firstDate = ZonedDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
val secondDate = ZonedDateTime.of(2018, 3, 9, 11, 30, 30, 30, ZoneId.of("America/Chicago"))
firstDate shouldNotHaveSameDayAs secondDate // Assertion fails, 9 == 9, and we expected a difference
MatchersKt.shouldHaveSameDayAspublic static Matcher<java.time.ZonedDateTime> haveSameDay(java.time.ZonedDateTime date)
Matcher that compares days of ZonedDateTimes
Verifies that two ZonedDateTimes have exactly the same day, ignoring any other fields. For example, 09/02/1998 10:00:00 -03:00 America/Sao_Paulo has the same day as 09/03/2018 11:30:30 -05:00 America/Chicago, and the matcher will have a positive result for this comparison
val firstDate = ZonedDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
val secondDate = ZonedDateTime.of(2018, 3, 9, 11, 30, 30, 30, ZoneId.of("America/Chicago"))
firstDate should haveSameDay(secondDate) // Assertion passes
val firstDate = ZonedDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
val secondDate = ZonedDateTime.of(1998, 2, 10, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
firstDate shouldNot haveSameDay(secondDate) // Assertion passes
public static void shouldHaveSameDayAs(java.time.OffsetDateTime $receiver,
java.time.OffsetDateTime date)
Asserts that this day is the same as date's day
Verifies that this day is the same as date's day, ignoring any other fields. For example, 09/02/1998 10:00:00 -03:00 has the day year as 09/02/1998 11:30:30 -05:00, and this assertion should pass for this comparison
Opposite of MatchersKt.shouldNotHaveSameDayAs
val firstDate = OffsetDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(2018, 3, 9, 11, 30, 30, 30, ZoneOffset.ofHours(-5))
firstDate shouldHaveSameDayAs secondDate // Assertion passes
val firstDate = OffsetDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(1998, 2, 10, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
firstDate shouldHaveSameDayAs secondDate // Assertion fails, 9 != 12
MatchersKt.shouldNotHaveSameDayAspublic static void shouldNotHaveSameDayAs(java.time.OffsetDateTime $receiver,
java.time.OffsetDateTime date)
Asserts that this day is NOT the same as date's day
Verifies that this day isn't the same as date's day, ignoring any other fields. For example, 09/02/1998 10:00:00 -03:00 doesn't have the same day as 10/02/1998 10:00:00 -03:00, and this assertion should pass for this comparison
Opposite of MatchersKt.shouldHaveSameDayAs
val firstDate = OffsetDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(1998, 2, 10, 19, 0, 0, 0, ZoneOffset.ofHours(-3))
firstDate shouldNotHaveSameDayAs secondDate // Assertion passes
val firstDate = OffsetDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(2018, 3, 9, 1, 30, 30, 30, ZoneOffset.ofHours(-5))
firstDate shouldNotHaveSameDayAs secondDate // Assertion fails, 9 == 9, and we expected a difference
MatchersKt.shouldHaveSameDayAspublic static Matcher<java.time.OffsetDateTime> haveSameDay(java.time.OffsetDateTime date)
Matcher that compares days of OffsetDateTimes
Verifies that two ZonedDateTimes have exactly the same day, ignoring any other fields. For example, 09/02/1998 10:00:00 -03:00 has the same day as 09/03/2018 11:30:30 -05:00, and the matcher will have a positive result for this comparison
val firstDate = OffsetDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(2018, 3, 9, 11, 30, 30, 30, ZoneOffset.ofHours(-5))
firstDate should haveSameDay(secondDate) // Assertion passes
val firstDate = OffsetDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(1998, 2, 10, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
firstDate shouldNot haveSameDay(secondDate) // Assertion passes
public static void shouldBeBefore(java.time.LocalDate $receiver,
java.time.LocalDate date)
Asserts that this is before date
Verifies that this is before date, comparing year, month and day. For example, 09/02/1998 is before 10/02/1998, and this assertion should pass for this comparison.
Opposite of MatchersKt.shouldNotBeBefore
val firstDate = LocalDate.of(1998, 2, 9)
val secondDate = LocalDate.of(1998, 2, 10)
firstDate shouldBeBefore secondDate // Assertion passes
val firstDate = LocalDate.of(1998, 2, 10)
val secondDate = LocalDate.of(1998, 2, 9)
firstDate shouldBeBefore secondDate // Assertion fails, 10/02/1998 is not before 09/02/1998 as expected.
public static void shouldNotBeBefore(java.time.LocalDate $receiver,
java.time.LocalDate date)
Asserts that this is NOT before date
Verifies that this is not before date, comparing year, month and day. For example, 10/02/1998 is not before 09/02/1998, and this assertion should pass for this comparison.
Opposite of MatchersKt.shouldBeBefore
val firstDate = LocalDate.of(1998, 2, 10)
val secondDate = LocalDate.of(1998, 2, 9)
firstDate shouldNotBeBefore secondDate // Assertion passes
val firstDate = LocalDate.of(1998, 2, 9)
val secondDate = LocalDate.of(1998, 2, 10)
firstDate shouldNotBeBefore secondDate // Assertion fails, 09/02/1998 is before 10/02/1998, and we expected the opposite.
public static Matcher<java.time.LocalDate> before(java.time.LocalDate date)
Matcher that compares two LocalDates and checks whether one is before the other
Verifies that two LocalDates occurs in a certain order, checking that one happened before the other. For example, 09/02/1998 is before 10/02/1998, and the matcher will have a positive result for this comparison
val firstDate = LocalDate.of(1998, 2, 9)
val secondDate = LocalDate.of(1998, 2, 10)
firstDate shouldBe before(secondDate) // Assertion passes
val firstDate = LocalDate.of(1998, 2, 10)
val secondDate = LocalDate.of(1998, 2, 9)
firstDate shouldNotBe before(secondDate) // Assertion passes
public static void shouldBeBefore(java.time.LocalDateTime $receiver,
java.time.LocalDateTime date)
Asserts that this is before date
Verifies that this is before date, comparing every field in the LocalDateTime. For example, 09/02/1998 00:00:00 is before 09/02/1998 00:00:01, and this assertion should pass for this comparison.
Opposite of MatchersKt.shouldNotBeBefore
val firstDate = LocalDateTime.of(1998, 2, 9, 0, 0, 0)
val secondDate = LocalDateTime.of(1998, 2, 9, 0, 0, 1)
firstDate shouldBeBefore secondDate // Assertion passes
val firstDate = LocalDateTime.of(1998, 2, 9, 0, 0, 1)
val secondDate = LocalDateTime.of(1998, 2, 9, 0, 0, 0)
firstDate shouldBeBefore secondDate // Assertion fails, firstDate is one second after secondDate
public static void shouldNotBeBefore(java.time.LocalDateTime $receiver,
java.time.LocalDateTime date)
Asserts that this is NOT before date
Verifies that this is not before date, comparing every field in the LocalDateTime. For example, 09/02/1998 00:00:01 is not before 09/02/1998 00:00:00, and this assertion should pass for this comparison.
Opposite of MatchersKt.shouldBeBefore
val firstDate = LocalDateTime.of(1998, 2, 9, 0, 0, 1)
val secondDate = LocalDateTime.of(1998, 2, 9, 0, 0, 0)
firstDate shouldNotBeBefore secondDate // Assertion passes
val firstDate = LocalDateTime.of(1998, 2, 9, 0, 0, 0)
val secondDate = LocalDateTime.of(1998, 2, 9, 0, 0, 1)
firstDate shouldNotBeBefore secondDate // Assertion fails, firstDate is one second before secondDate and we didn't expect it
public static Matcher<java.time.LocalDateTime> before(java.time.LocalDateTime date)
Matcher that compares two LocalDateTimes and checks whether one is before the other
Verifies that two LocalDateTimes occurs in a certain order, checking that one happened before the other. For example, 09/02/1998 00:00:00 is before 09/02/1998 00:00:01, and the matcher will have a positive result for this comparison
val firstDate = LocalDateTime.of(1998, 2, 9, 0, 0, 0)
val secondDate = LocalDateTime.of(1998, 2, 9, 0, 0, 1)
firstDate shouldBe before(secondDate) // Assertion passes
val firstDate = LocalDateTime.of(1998, 2, 9, 0, 0, 1)
val secondDate = LocalDateTime.of(1998, 2, 9, 0, 0, 0)
firstDate shouldNotBe before(secondDate) // Assertion passes
public static void shouldBeBefore(java.time.ZonedDateTime $receiver,
java.time.ZonedDateTime date)
Asserts that this is before date
Verifies that this is before date, comparing every field in the ZonedDateTime. For example, 09/02/1998 00:00:00 -03:00 America/Sao_Paulo is before 09/02/1998 00:00:01 -03:00 America/Sao_Paulo, and this assertion should pass for this comparison.
Opposite of MatchersKt.shouldNotBeBefore
val firstDate = ZonedDateTime.of(1998, 2, 9, 0, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
val secondDate = ZonedDateTime.of(1998, 2, 9, 0, 0, 1, 0, ZoneId.of("America/Sao_Paulo"))
firstDate shouldBeBefore secondDate // Assertion passes
val firstDate = ZonedDateTime.of(1998, 2, 9, 0, 0, 1, 0, ZoneId.of("America/Sao_Paulo"))
val secondDate = ZonedDateTime.of(1998, 2, 9, 0, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
firstDate shouldBeBefore secondDate // Assertion fails, firstDate is one second after secondDate
public static void shouldNotBeBefore(java.time.ZonedDateTime $receiver,
java.time.ZonedDateTime date)
Asserts that this is NOT before date
Verifies that this is not before date, comparing every field in the ZonedDateTime. For example, 09/02/1998 00:00:01 -03:00 America/Sao_Paulo is not before 09/02/1998 00:00:00 -03:00 America/Sao_Paulo, and this assertion should pass for this comparison.
Opposite of MatchersKt.shouldBeBefore
val firstDate = ZonedDateTime.of(1998, 2, 9, 0, 0, 1, 0, ZoneId.of("America/Sao_Paulo"))
val secondDate = ZonedDateTime.of(1998, 2, 9, 0, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
firstDate shouldNotBeBefore secondDate // Assertion passes
val firstDate = ZonedDateTime.of(1998, 2, 9, 0, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
val secondDate = ZonedDateTime.of(1998, 2, 9, 0, 0, 1, 0, ZoneId.of("America/Sao_Paulo"))
firstDate shouldNotBeBefore secondDate // Assertion fails, firstDate is one second before secondDate and we didn't expect it
public static Matcher<java.time.ZonedDateTime> before(java.time.ZonedDateTime date)
Matcher that compares two ZonedDateTimes and checks whether one is before the other
Verifies that two ZonedDateTimes occurs in a certain order, checking that one happened before the other. For example, 09/02/1998 00:00:00 -03:00 America/Sao_Paulo is before 09/02/1998 00:00:01 -03:00 America/Sao_Paulo, and the matcher will have a positive result for this comparison
val firstDate = ZonedDateTime.of(1998, 2, 9, 0, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
val secondDate = ZonedDateTime.of(1998, 2, 9, 0, 0, 1, 0, ZoneId.of("America/Sao_Paulo"))
firstDate shouldBe before(secondDate) // Assertion passes
val firstDate = ZonedDateTime.of(1998, 2, 9, 0, 0, 1, 0, ZoneId.of("America/Sao_Paulo"))
val secondDate = ZonedDateTime.of(1998, 2, 9, 0, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
firstDate shouldNotBe before(secondDate) // Assertion passes
public static void shouldBeBefore(java.time.OffsetDateTime $receiver,
java.time.OffsetDateTime date)
Asserts that this is before date
Verifies that this is before date, comparing every field in the OffsetDateTime. For example, 09/02/1998 00:00:00 -03:00 is before 09/02/1998 00:00:01 -03:00, and this assertion should pass for this comparison.
Opposite of MatchersKt.shouldNotBeBefore
val firstDate = OffsetDateTime.of(1998, 2, 9, 0, 0, 0, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(1998, 2, 9, 0, 0, 1, 0, ZoneOffset.ofHours(-3))
firstDate shouldBeBefore secondDate // Assertion passes
val firstDate = OffsetDateTime.of(1998, 2, 9, 0, 0, 1, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(1998, 2, 9, 0, 0, 0, 0, ZoneOffset.ofHours(-3))
firstDate shouldBeBefore secondDate // Assertion fails, firstDate is one second after secondDate
public static void shouldNotBeBefore(java.time.OffsetDateTime $receiver,
java.time.OffsetDateTime date)
Asserts that this is NOT before date
Verifies that this is not before date, comparing every field in the OffsetDateTime. For example, 09/02/1998 00:00:01 -03:00 is not before 09/02/1998 00:00:00 -03:00, and this assertion should pass for this comparison.
Opposite of MatchersKt.shouldBeBefore
val firstDate = OffsetDateTime.of(1998, 2, 9, 0, 0, 1, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(1998, 2, 9, 0, 0, 0, 0, ZoneOffset.ofHours(-3))
firstDate shouldNotBeBefore secondDate // Assertion passes
val firstDate = OffsetDateTime.of(1998, 2, 9, 0, 0, 0, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(1998, 2, 9, 0, 0, 1, 0, ZoneOffset.ofHours(-3))
firstDate shouldNotBeBefore secondDate // Assertion fails, firstDate is one second before secondDate and we didn't expect it
public static Matcher<java.time.OffsetDateTime> before(java.time.OffsetDateTime date)
Matcher that compares two OffsetDateTimes and checks whether one is before the other
Verifies that two OffsetDateTimes occurs in a certain order, checking that one happened before the other. For example, 09/02/1998 00:00:00 -03:00 is before 09/02/1998 00:00:01 -03:00, and the matcher will have a positive result for this comparison
val firstDate = OffsetDateTime.of(1998, 2, 9, 0, 0, 0, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(1998, 2, 9, 0, 0, 1, 0, ZoneOffset.ofHours(-3))
firstDate shouldBe before(secondDate) // Assertion passes
val firstDate = OffsetDateTime.of(1998, 2, 9, 0, 0, 1, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(1998, 2, 9, 0, 0, 0, 0, ZoneOffset.ofHours(-3))
firstDate shouldNotBe before(secondDate) // Assertion passes
public static void shouldBeAfter(java.time.LocalDate $receiver,
java.time.LocalDate date)
Asserts that this is after date
Verifies that this is after date, comparing year, month and day. For example, 09/02/1998 is after 08/02/1998, and this assertion should pass for this comparison.
Opposite of MatchersKt.shouldNotBeAfter
val firstDate = LocalDate.of(1998, 2, 9)
val secondDate = LocalDate.of(1998, 2, 8)
firstDate shouldBeAfter secondDate // Assertion passes
val firstDate = LocalDate.of(1998, 2, 9)
val secondDate = LocalDate.of(1998, 2, 10)
firstDate shouldBeAfter secondDate // Assertion fails, firstDate is NOT after secondDate
public static void shouldNotBeAfter(java.time.LocalDate $receiver,
java.time.LocalDate date)
Asserts that this is NOT after date
Verifies that this is not after date, comparing year, month and day. For example, 09/02/1998 is not after 10/02/1998, and this assertion should pass for this comparison.
Opposite of MatchersKt.shouldBeAfter
val firstDate = LocalDate.of(1998, 2, 9)
val secondDate = LocalDate.of(1998, 2, 10)
firstDate shouldNotBeAfter secondDate // Assertion passes
val firstDate = LocalDate.of(1998, 2, 10)
val secondDate = LocalDate.of(1998, 2, 9)
firstDate shouldNotBeAfter secondDate // Assertion fails, first date IS after secondDate
public static Matcher<java.time.LocalDate> after(java.time.LocalDate date)
Matcher that compares two LocalDates and checks whether one is after the other
Verifies that two LocalDates 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 = LocalDate.of(1998, 2, 9)
val secondDate = LocalDate.of(1998, 2, 8)
firstDate shouldBe after(secondDate ) // Assertion passes
val firstDate = LocalDate.of(1998, 2, 9)
val secondDate = LocalDate.of(1998, 2, 10)
firstDate shouldNotBe after(secondDate) // Assertion passes
public static void shouldBeAfter(java.time.LocalDateTime $receiver,
java.time.LocalDateTime date)
Asserts that this is after date
Verifies that this is after date, comparing all fields in LocalDateTime. For example, 09/02/1998 10:00:00 is after 09/02/1998 09:00:00, and this assertion should pass for this comparison.
Opposite of MatchersKt.shouldNotBeAfter
val firstDate = LocalDateTime.of(1998, 2, 9, 10, 0, 0)
val secondDate = LocalDateTime.of(1998, 2, 8, 10, 0, 0)
firstDate shouldBeAfter secondDate // Assertion passes
val firstDate = LocalDateTime.of(1998, 2, 9, 10, 0, 0)
val secondDate = LocalDateTime.of(1998, 2, 10, 10, 0, 0)
firstDate shouldBeAfter secondDate // Assertion fails, firstDate is NOT after secondDate
public static void shouldNotBeAfter(java.time.LocalDateTime $receiver,
java.time.LocalDateTime date)
Asserts that this is NOT after date
Verifies that this is not after date, comparing all fields in LocalDateTime. For example, 09/02/1998 09:00:00 is not after 09/02/1998 10:00:00, and this assertion should pass for this comparison.
Opposite of MatchersKt.shouldBeAfter
val firstDate = LocalDateTime.of(1998, 2, 9, 10, 0, 0)
val secondDate = LocalDateTime.of(1998, 2, 10, 10, 0, 0)
firstDate shouldNotBeAfter secondDate // Assertion passes
val firstDate = LocalDateTime.of(1998, 2, 10, 10, 0, 0)
val secondDate = LocalDateTime.of(1998, 2, 9, 10, 0, 0)
firstDate shouldNotBeAfter secondDate // Assertion fails, first date IS after secondDate
public static Matcher<java.time.LocalDateTime> after(java.time.LocalDateTime date)
Matcher that compares two LocalDateTimes and checks whether one is after the other
Verifies that two LocalDateTimes occurs in a certain order, checking that one happened after the other. For example, 09/02/1998 10:00:00 is after 09/02/1998 09:00:00, and the matcher will have a positive result for this comparison
val firstDate = LocalDateTime.of(1998, 2, 9, 10, 0, 0)
val secondDate = LocalDateTime.of(1998, 2, 8, 10, 0, 0)
firstDate shouldBe after(secondDate ) // Assertion passes
val firstDate = LocalDateTime.of(1998, 2, 9, 10, 0, 0)
val secondDate = LocalDateTime.of(1998, 2, 10, 10, 0, 0)
firstDate shouldNotBe after(secondDate) // Assertion passes
public static void shouldBeAfter(java.time.ZonedDateTime $receiver,
java.time.ZonedDateTime date)
Asserts that this is after date
Verifies that this is after date, comparing all fields in ZonedDateTime. For example, 09/02/1998 10:00:00 -03:00 America/Sao_Paulo is after 09/02/1998 09:00:00 -03:00 America/Sao_Paulo, and this assertion should pass for this comparison.
Opposite of MatchersKt.shouldNotBeAfter
val firstDate = ZonedDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
val secondDate = ZonedDateTime.of(1998, 2, 8, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
firstDate shouldBeAfter secondDate // Assertion passes
val firstDate = ZonedDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
val secondDate = ZonedDateTime.of(1998, 2, 10, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
firstDate shouldBeAfter secondDate // Assertion fails, firstDate is NOT after secondDate
public static void shouldNotBeAfter(java.time.ZonedDateTime $receiver,
java.time.ZonedDateTime date)
Asserts that this is NOT after date
Verifies that this is not after date, comparing all fields in ZonedDateTime. For example, 09/02/1998 09:00:00 -03:00 America/Sao_Paulo is not after 09/02/1998 10:00:00 -03:00 America/Sao_Paulo, and this assertion should pass for this comparison.
Opposite of MatchersKt.shouldBeAfter
val firstDate = ZonedDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
val secondDate = ZonedDateTime.of(1998, 2, 10, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
firstDate shouldNotBeAfter secondDate // Assertion passes
val firstDate = ZonedDateTime.of(1998, 2, 10, 10, 0, 0, ZoneId.of("America/Sao_Paulo"))
val secondDate = ZonedDateTime.of(1998, 2, 9, 10, 0, 0, ZoneId.of("America/Sao_Paulo"))
firstDate shouldNotBeAfter secondDate // Assertion fails, first date IS after secondDate
public static Matcher<java.time.ZonedDateTime> after(java.time.ZonedDateTime date)
Matcher that compares two ZonedDateTimes and checks whether one is after the other
Verifies that two ZonedDateTimes occurs in a certain order, checking that one happened after the other. For example, 09/02/1998 10:00:00 -03:00 America/Sao_Paulo is after 09/02/1998 09:00:00 -03:00 America/Sao_Paulo, and the matcher will have a positive result for this comparison
val firstDate = ZonedDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
val secondDate = ZonedDateTime.of(1998, 2, 8, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
firstDate shouldBe after(secondDate ) // Assertion passes
val firstDate = ZonedDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
val secondDate = ZonedDateTime.of(1998, 2, 10, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo"))
firstDate shouldNotBe after(secondDate) // Assertion passes
public static void shouldBeAfter(java.time.OffsetDateTime $receiver,
java.time.OffsetDateTime date)
Asserts that this is after date
Verifies that this is after date, comparing all fields in OffsetDateTime. For example, 09/02/1998 10:00:00 -03:00 is after 09/02/1998 09:00:00 -03:00, and this assertion should pass for this comparison.
Opposite of MatchersKt.shouldNotBeAfter
val firstDate = OffsetDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(1998, 2, 8, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
firstDate shouldBeAfter secondDate // Assertion passes
val firstDate = OffsetDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(1998, 2, 10, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
firstDate shouldBeAfter secondDate // Assertion fails, firstDate is NOT after secondDate
public static void shouldNotBeAfter(java.time.OffsetDateTime $receiver,
java.time.OffsetDateTime date)
Asserts that this is NOT after date
Verifies that this is not after date, comparing all fields in OffsetDateTime. For example, 09/02/1998 09:00:00 -03:00 is not after 09/02/1998 10:00:00 -03:00, and this assertion should pass for this comparison.
Opposite of MatchersKt.shouldBeAfter
val firstDate = OffsetDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(1998, 2, 10, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
firstDate shouldNotBeAfter secondDate // Assertion passes
val firstDate = OffsetDateTime.of(1998, 2, 10, 10, 0, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(1998, 2, 9, 10, 0, 0, ZoneOffset.ofHours(-3))
firstDate shouldNotBeAfter secondDate // Assertion fails, first date IS after secondDate
public static Matcher<java.time.OffsetDateTime> after(java.time.OffsetDateTime date)
Matcher that compares two OffsetDateTimes and checks whether one is after the other
Verifies that two OffsetDateTimes occurs in a certain order, checking that one happened after the other. For example, 09/02/1998 10:00:00 -03:00 is after 09/02/1998 09:00:00 -03:00, and the matcher will have a positive result for this comparison
val firstDate = OffsetDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(1998, 2, 8, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
firstDate shouldBe after(secondDate ) // Assertion passes
val firstDate = OffsetDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(1998, 2, 10, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
firstDate shouldNotBe after(secondDate) // Assertion passes
public static void shouldBeWithin(java.time.LocalDate $receiver,
java.time.Period period,
java.time.LocalDate date)
Asserts that this is within period of date
Verifies that this is within period of date. For example, 09/02/1998 is within 3 days of 10/02/1998, and this assertion should pass for this comparison.
Opposite of MatchersKt.shouldNotBeWithin
val firstDate = LocalDate.of(1998, 2, 9)
val secondDate = LocalDate.of(1998, 2, 10)
firstDate.shouldBeWithin(Period.ofDays(3), secondDate) // Assertion passes
val firstDate = LocalDate.of(1998, 2, 9)
val secondDate = LocalDate.of(1998, 2, 25)
firstDate.shouldBeWithin(Period.ofDays(3), secondDate) // Assertion fails, firstDate is not within 3 days of secondDate
MatchersKt.shouldNotBeWithinpublic static void shouldNotBeWithin(java.time.LocalDate $receiver,
java.time.Period period,
java.time.LocalDate date)
Asserts that this is NOT within period of date
Verifies that this is not within period of date. For example, 09/02/1998 is not within 3 days of 25/02/1998, and this assertion should pass for this comparison.
Opposite of MatchersKt.shouldBeWithin
val firstDate = LocalDate.of(1998, 2, 9)
val secondDate = LocalDate.of(1998, 2, 25)
firstDate.shouldNotBeWithin(Period.ofDays(3), secondDate) // Assertion passes
val firstDate = LocalDate.of(1998, 2, 9)
val secondDate = LocalDate.of(1998, 2, 10)
firstDate.shouldNotBeWithin(Period.ofDays(3), secondDate) // Assertion fails, firstDate is within 3 days of secondDate, and we expected not to
MatchersKt.shouldBeWithinpublic static Matcher<java.time.LocalDate> within(java.time.Period period, java.time.LocalDate date)
Matcher that compares two LocalDates and checks whether one is within period of the other
Verifies that two LocalDates are within a certain period. For example, 09/02/1998 is within 3 days of 10/02/1998, and the matcher will have a positive result for this comparison.
val firstDate = LocalDate.of(1998, 2, 9)
val secondDate = LocalDate.of(1998, 2, 10)
firstDate shouldBe within(Period.ofDays(3), secondDate) // Assertion passes
val firstDate = LocalDate.of(1998, 2, 9)
val secondDate = LocalDate.of(1998, 2, 25)
firstDate shouldNotBe within(Period.ofDays(3), secondDate) // Assertion passes
public static void shouldBeWithin(java.time.LocalDateTime $receiver,
java.time.temporal.TemporalAmount temporalAmount,
java.time.LocalDateTime date)
Asserts that this is within temporalAmount of date
Verifies that this is within temporalAmount of date. For example, 09/02/1998 10:00:00 is within 3 days of 10/02/1998 10:00:00, and this assertion should pass for this comparison.
Opposite of MatchersKt.shouldNotBeWithin
val firstDate = LocalDateTime.of(1998, 2, 9, 10, 0, 0)
val secondDate = LocalDateTime.of(1998, 2, 10, 10, 0, 0)
firstDate.shouldBeWithin(Period.ofDays(3), secondDate) // Assertion passes
val firstDate = LocalDateTime.of(1998, 2, 9, 10, 0, 0)
val secondDate = LocalDateTime.of(1998, 2, 25, 10, 0, 0)
firstDate.shouldBeWithin(Period.ofDays(3), secondDate) // Assertion fails, firstDate is not within 3 days of secondDate
MatchersKt.shouldNotBeWithinpublic static void shouldNotBeWithin(java.time.LocalDateTime $receiver,
java.time.temporal.TemporalAmount temporalAmount,
java.time.LocalDateTime date)
Asserts that this is NOT within temporalAmount of date
Verifies that this is not within temporalAmount of date. For example, 09/02/1998 10:00:00 is not within 3 days of 25/02/1998 10:00:00, and this assertion should pass for this comparison.
Opposite of MatchersKt.shouldBeWithin
val firstDate = LocalDateTime.of(1998, 2, 9, 10, 0, 0)
val secondDate = LocalDateTime.of(1998, 2, 25, 10, 0, 0)
firstDate.shouldNotBeWithin(Period.ofDays(3), secondDate) // Assertion passes
val firstDate = LocalDateTime.of(1998, 2, 9, 10, 0, 0)
val secondDate = LocalDateTime.of(1998, 2, 10, 10, 0, 0)
firstDate.shouldNotBeWithin(Period.ofDays(3), secondDate) // Assertion fails, firstDate is within 3 days of secondDate, and we expected not to
MatchersKt.shouldBeWithinpublic static Matcher<java.time.LocalDateTime> within(java.time.temporal.TemporalAmount temporalAmount, java.time.LocalDateTime date)
Matcher that compares two LocalDateTimes and checks whether one is within temporalAmount of the other
Verifies that two LocalDateTimes are within a certain period. For example, 09/02/1998 10:00:00 is within 3 days of 10/02/1998 10:00:00, and the matcher will have a positive result for this comparison.
val firstDate = LocalDateTime.of(1998, 2, 9, 10, 0, 0)
val secondDate = LocalDateTime.of(1998, 2, 10, 10, 0, 0)
firstDate shouldBe within(Period.ofDays(3), secondDate) // Assertion passes
val firstDate = LocalDateTime.of(1998, 2, 9, 10, 0, 0)
val secondDate = LocalDateTime.of(1998, 2, 25, 10, 0, 0)
firstDate shouldNotBe within(Period.ofDays(3), secondDate) // Assertion passes
public static void shouldBeWithin(java.time.ZonedDateTime $receiver,
java.time.temporal.TemporalAmount temporalAmount,
java.time.ZonedDateTime date)
Asserts that this is within temporalAmount of date
Verifies that this is within temporalAmount of date. For example, 09/02/1998 10:00:00 -03:00 America/Sao_Paulo is within 3 days of 10/02/1998 10:00:00 -03:00 America/Sao_Paulo, and this assertion should pass for this comparison.
Opposite of MatchersKt.shouldNotBeWithin
val firstDate = ZonedDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo))
val secondDate = ZonedDateTime.of(1998, 2, 10, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo))
firstDate.shouldBeWithin(Period.ofDays(3), secondDate) // Assertion passes
val firstDate = ZonedDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo))
val secondDate = ZonedDateTime.of(1998, 2, 25, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo))
firstDate.shouldBeWithin(Period.ofDays(3), secondDate) // Assertion fails, firstDate is not within 3 days of secondDate
MatchersKt.shouldNotBeWithinpublic static void shouldNotBeWithin(java.time.ZonedDateTime $receiver,
java.time.temporal.TemporalAmount temporalAmount,
java.time.ZonedDateTime date)
Asserts that this is NOT within temporalAmount of date
Verifies that this is not within temporalAmount of date. For example, 09/02/1998 10:00:00 -03:00 America/Sao_Paulo is not within 3 days of 25/02/1998 10:00:00 -03:00 America/Sao_Paulo, and this assertion should pass for this comparison.
Opposite of MatchersKt.shouldBeWithin
val firstDate = ZonedDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo))
val secondDate = ZonedDateTime.of(1998, 2, 25, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo))
firstDate.shouldNotBeWithin(Period.ofDays(3), secondDate) // Assertion passes
val firstDate = ZonedDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo))
val secondDate = ZonedDateTime.of(1998, 2, 10, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo))
firstDate.shouldNotBeWithin(Period.ofDays(3), secondDate) // Assertion fails, firstDate is within 3 days of secondDate, and we expected not to
MatchersKt.shouldBeWithinpublic static Matcher<java.time.ZonedDateTime> within(java.time.temporal.TemporalAmount temporalAmount, java.time.ZonedDateTime date)
Matcher that compares two ZonedDateTimes and checks whether one is within temporalAmount of the other
Verifies that two ZonedDateTimes are within a certain period. For example, 09/02/1998 10:00:00 -03:00 America/Sao_Paulo is within 3 days of 10/02/1998 10:00:00 -03:00 America/Sao_Paulo, and the matcher will have a positive result for this comparison.
val firstDate = ZonedDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo))
val secondDate = ZonedDateTime.of(1998, 2, 10, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo))
firstDate shouldBe within(Period.ofDays(3), secondDate) // Assertion passes
val firstDate = ZonedDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo))
val secondDate = ZonedDateTime.of(1998, 2, 25, 10, 0, 0, 0, ZoneId.of("America/Sao_Paulo))
firstDate shouldNotBe within(Period.ofDays(3), secondDate) // Assertion passes
public static void shouldBeWithin(java.time.OffsetDateTime $receiver,
java.time.temporal.TemporalAmount temporalAmount,
java.time.OffsetDateTime date)
Asserts that this is within temporalAmount of date
Verifies that this is within temporalAmount of date. For example, 09/02/1998 10:00:00 -03:00 is within 3 days of 10/02/1998 10:00:00 -03:00, and this assertion should pass for this comparison.
Opposite of MatchersKt.shouldNotBeWithin
val firstDate = OffsetDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneOffset.ofHours(-3)
val secondDate = OffsetDateTime.of(1998, 2, 10, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
firstDate.shouldBeWithin(Period.ofDays(3), secondDate) // Assertion passes
val firstDate = OffsetDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(1998, 2, 25, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
firstDate.shouldBeWithin(Period.ofDays(3), secondDate) // Assertion fails, firstDate is not within 3 days of secondDate
MatchersKt.shouldNotBeWithinpublic static void shouldNotBeWithin(java.time.OffsetDateTime $receiver,
java.time.temporal.TemporalAmount temporalAmount,
java.time.OffsetDateTime date)
Asserts that this is NOT within temporalAmount of date
Verifies that this is not within temporalAmount of date. For example, 09/02/1998 10:00:00 -03:00 is not within 3 days of 25/02/1998 10:00:00 -03:00, and this assertion should pass for this comparison.
Opposite of MatchersKt.shouldBeWithin
val firstDate = OffsetDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(1998, 2, 25, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
firstDate.shouldNotBeWithin(Period.ofDays(3), secondDate) // Assertion passes
val firstDate = OffsetDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(1998, 2, 10, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
firstDate.shouldNotBeWithin(Period.ofDays(3), secondDate) // Assertion fails, firstDate is within 3 days of secondDate, and we expected not to
MatchersKt.shouldBeWithinpublic static Matcher<java.time.OffsetDateTime> within(java.time.temporal.TemporalAmount temporalAmount, java.time.OffsetDateTime date)
Matcher that compares two OffsetDateTimes and checks whether one is within temporalAmount of the other
Verifies that two OffsetDateTimes are within a certain period. For example, 09/02/1998 10:00:00 -03:00 is within 3 days of 10/02/1998 10:00:00 -03:00, and the matcher will have a positive result for this comparison.
val firstDate = OffsetDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(1998, 2, 10, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
firstDate shouldBe within(Period.ofDays(3), secondDate) // Assertion passes
val firstDate = OffsetDateTime.of(1998, 2, 9, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(1998, 2, 25, 10, 0, 0, 0, ZoneOffset.ofHours(-3))
firstDate shouldNotBe within(Period.ofDays(3), secondDate) // Assertion passes
public static void shouldBeBetween(java.time.LocalDate $receiver,
java.time.LocalDate a,
java.time.LocalDate b)
Asserts that this is between a and b
Verifies that this is after a and before b, comparing year, month and day.
Opposite of MatchersKt.shouldNotBeBetween
val date = LocalDate.of(2019, 2, 16)
val firstDate = LocalDate.of(2019, 2, 15)
val secondDate = LocalDate.of(2019, 2, 17)
date.shouldBeBetween(firstDate, secondDate) // Assertion passes
val date = LocalDate.of(2019, 2, 15)
val firstDate = LocalDate.of(2019, 2, 16)
val secondDate = LocalDate.of(2019, 2, 17)
date.shouldBeBetween(firstDate, secondDate) // Assertion fails, date is NOT between firstDate and secondDate
public static void shouldNotBeBetween(java.time.LocalDate $receiver,
java.time.LocalDate a,
java.time.LocalDate b)
Asserts that this is NOT between a and b
Verifies that this is not after a and before b, comparing year, month and day.
Opposite of MatchersKt.shouldBeBetween
val date = LocalDate.of(2019, 2, 15)
val firstDate = LocalDate.of(2019, 2, 16)
val secondDate = LocalDate.of(2019, 2, 17)
date.shouldNotBeBetween(firstDate, secondDate) // Assertion passes
val date = LocalDate.of(2019, 2, 16)
val firstDate = LocalDate.of(2019, 2, 15)
val secondDate = LocalDate.of(2019, 2, 17)
date.shouldNotBeBetween(firstDate, secondDate) // Assertion fails, date IS between firstDate and secondDate
public static Matcher<java.time.LocalDate> between(java.time.LocalDate a, java.time.LocalDate b)
Matcher that checks if LocalDate is between two other LocalDates
Verifies that LocalDate is after the first LocalDate and before the second LocalDate For example, 20/03/2019 is between 19/03/2019 and 21/03/2019, and the matcher will have a positive result for this comparison
val date = LocalDate.of(2019, 2, 16)
val firstDate = LocalDate.of(2019, 2, 15)
val secondDate = LocalDate.of(2019, 2, 17)
date shouldBe after(firstDate, secondDate) // Assertion passes
val date = LocalDate.of(2019, 2, 15)
val firstDate = LocalDate.of(2019, 2, 16)
val secondDate = LocalDate.of(2019, 2, 17)
date shouldNotBe between(firstDate, secondDate) // Assertion passes
public static void shouldBeBetween(java.time.LocalDateTime $receiver,
java.time.LocalDateTime a,
java.time.LocalDateTime b)
Asserts that this is between a and b
Verifies that this is after a and before b, comparing all fields in LocalDateTime.
Opposite of MatchersKt.shouldNotBeBetween
val date = LocalDateTime.of(2019, 2, 16, 12, 0, 0)
val firstDate = LocalDateTime.of(2019, 2, 15, 12, 0, 0)
val secondDate = LocalDateTime.of(2019, 2, 17, 12, 0, 0)
date.shouldBeBetween(firstDate, secondDate) // Assertion passes
val date = LocalDateTime.of(2019, 2, 15, 12, 0, 0)
val firstDate = LocalDateTime.of(2019, 2, 16, 12, 0, 0)
val secondDate = LocalDateTime.of(2019, 2, 17, 12, 0, 0)
date.shouldBeBetween(firstDate, secondDate) // Assertion fails, date is NOT between firstDate and secondDate
public static void shouldNotBeBetween(java.time.LocalDateTime $receiver,
java.time.LocalDateTime a,
java.time.LocalDateTime b)
Asserts that this is NOT between a and b
Verifies that this is not after a and before b, comparing all fields in LocalDateTime.
Opposite of MatchersKt.shouldBeBetween
val date = LocalDateTime.of(2019, 2, 15, 12, 0, 0)
val firstDate = LocalDateTime.of(2019, 2, 16, 12, 0, 0)
val secondDate = LocalDateTime.of(2019, 2, 17, 12, 0, 0)
date.shouldNotBeBetween(firstDate, secondDate) // Assertion passes
val date = LocalDateTime.of(2019, 2, 16, 12, 0, 0)
val firstDate = LocalDateTime.of(2019, 2, 15, 12, 0, 0)
val secondDate = LocalDateTime.of(2019, 2, 17, 12, 0, 0)
date.shouldNotBeBetween(firstDate, secondDate) // Assertion fails, date IS between firstDate and secondDate
public static Matcher<java.time.LocalDateTime> between(java.time.LocalDateTime a, java.time.LocalDateTime b)
Matcher that checks if LocalDateTime is between two other LocalDateTimes
Verifies that LocalDateTime is after the first LocalDateTime and before the second LocalDateTime For example, 20/03/2019 10:00:00 is between 19/03/2019 10:00:00 and 21/03/2019 10:00:00, and the matcher will have a positive result for this comparison
val date = LocalDateTime.of(2019, 2, 16, 12, 0, 0)
val firstDate = LocalDateTime.of(2019, 2, 15, 12, 0, 0)
val secondDate = LocalDateTime.of(2019, 2, 17, 12, 0, 0)
date shouldBe after(firstDate, secondDate) // Assertion passes
val date = LocalDateTime.of(2019, 2, 15, 12, 0, 0)
val firstDate = LocalDateTime.of(2019, 2, 16, 12, 0, 0)
val secondDate = LocalDateTime.of(2019, 2, 17, 12, 0, 0)
date shouldNotBe between(firstDate, secondDate) // Assertion passes
public static void shouldBeBetween(java.time.ZonedDateTime $receiver,
java.time.ZonedDateTime a,
java.time.ZonedDateTime b)
Asserts that this is between a and b
Verifies that this is after a and before b, comparing all fields in ZonedDateTime.
Opposite of MatchersKt.shouldNotBeBetween
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.shouldBeBetween(firstDate, secondDate) // Assertion passes
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.shouldBeBetween(firstDate, secondDate) // Assertion fails, date is NOT between firstDate and secondDate
public static void shouldNotBeBetween(java.time.ZonedDateTime $receiver,
java.time.ZonedDateTime a,
java.time.ZonedDateTime b)
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 MatchersKt.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
public static Matcher<java.time.ZonedDateTime> between(java.time.ZonedDateTime a, java.time.ZonedDateTime b)
Matcher that checks if ZonedDateTime is between two other ZonedDateTimes
Verifies that ZonedDateTime is after the first ZonedDateTime and before the second ZonedDateTime For example, 20/03/2019 10:00:00 -03:00 America/Sao_Paulo is between 19/03/2019 10:00:00 -03:00 America/Sao_Paulo and 21/03/2019 10:00:00 -03:00 America/Sao_Paulo, and the matcher will have a positive result for this comparison
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 shouldBe after(firstDate, secondDate) // Assertion passes
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 shouldNotBe between(firstDate, secondDate) // Assertion passes
public static void shouldBeBetween(java.time.OffsetDateTime $receiver,
java.time.OffsetDateTime a,
java.time.OffsetDateTime b)
Asserts that this is between a and b
Verifies that this is after a and before b, comparing all fields in ZonedDateTime.
Opposite of MatchersKt.shouldNotBeBetween
val date = OffsetDateTime.of(2019, 2, 16, 12, 0, 0, 0, ZoneOffset.ofHours(-3))
val firstDate = OffsetDateTime.of(2019, 2, 15, 12, 0, 0, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(2019, 2, 17, 12, 0, 0, 0, ZoneOffset.ofHours(-3))
date.shouldBeBetween(firstDate, secondDate) // Assertion passes
val date = OffsetDateTime.of(2019, 2, 15, 12, 0, 0, 0, ZoneOffset.ofHours(-3))
val firstDate = OffsetDateTime.of(2019, 2, 16, 12, 0, 0, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(2019, 2, 17, 12, 0, 0, 0, ZoneOffset.ofHours(-3))
date.shouldBeBetween(firstDate, secondDate) // Assertion fails, date is NOT between firstDate and secondDate
public static void shouldNotBeBetween(java.time.OffsetDateTime $receiver,
java.time.OffsetDateTime a,
java.time.OffsetDateTime b)
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 MatchersKt.shouldBeBetween
val date = OffsetDateTime.of(2019, 2, 15, 12, 0, 0, 0, ZoneOffset.ofHours(-3))
val firstDate = OffsetDateTime.of(2019, 2, 16, 12, 0, 0, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(2019, 2, 17, 12, 0, 0, 0, ZoneOffset.ofHours(-3))
date.shouldNotBeBetween(firstDate, secondDate) // Assertion passes
val date = OffsetDateTime.of(2019, 2, 16, 12, 0, 0, 0, ZoneOffset.ofHours(-3))
val firstDate = OffsetDateTime.of(2019, 2, 15, 12, 0, 0, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(2019, 2, 17, 12, 0, 0, 0, ZoneOffset.ofHours(-3))
date.shouldNotBeBetween(firstDate, secondDate) // Assertion fails, date IS between firstDate and secondDate
public static Matcher<java.time.OffsetDateTime> between(java.time.OffsetDateTime a, java.time.OffsetDateTime b)
Matcher that checks if OffsetDateTime is between two other OffsetDateTimes
Verifies that OffsetDateTime is after the first OffsetDateTime and before the second OffsetDateTime For example, 20/03/2019 10:00:00 -03:00 is between 19/03/2019 10:00:00 -03:00 and 21/03/2019 10:00:00 -03:00, and the matcher will have a positive result for this comparison
val date = OffsetDateTime.of(2019, 2, 16, 12, 0, 0, 0, ZoneOffset.ofHours(-3))
val firstDate = OffsetDateTime.of(2019, 2, 15, 12, 0, 0, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(2019, 2, 17, 12, 0, 0, 0, ZoneOffset.ofHours(-3))
date shouldBe after(firstDate, secondDate) // Assertion passes
val date = OffsetDateTime.of(2019, 2, 15, 12, 0, 0, 0, ZoneOffset.ofHours(-3))
val firstDate = OffsetDateTime.of(2019, 2, 16, 12, 0, 0, 0, ZoneOffset.ofHours(-3))
val secondDate = OffsetDateTime.of(2019, 2, 17, 12, 0, 0, 0, ZoneOffset.ofHours(-3))
date shouldNotBe between(firstDate, secondDate) // Assertion passes