infix fun LocalDate.shouldHaveSameYearAs(date: LocalDate): Unit
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 LocalDate.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