/** * Returns true if both date are in the same year and month, false otherwise. * @param actual the actual date. expected not be null * @param other the other date. expected not be null * @return true if both date are in the same year and month, false otherwise */ private static boolean areInSameMonth(Date actual, Date other) { return areInSameYear(actual, other) && monthOf(actual) == monthOf(other); }
/** * Returns true if both date are in the same year and month, false otherwise. * @param actual the actual date. expected not be null * @param other the other date. expected not be null * @return true if both date are in the same year and month, false otherwise */ private static boolean areInSameMonth(Date actual, Date other) { return areInSameYear(actual, other) && monthOf(actual) == monthOf(other); }
/** * Verifies that the actual {@code Date} month is equal to the given month, <b>month value starting at 1</b> (January=1, * February=2, ...). * @param info contains information about the assertion. * @param actual the "actual" {@code Date}. * @param month the month to compare actual month to, see {@link Calendar#MONTH} for valid values * @throws AssertionError if {@code actual} is {@code null}. * @throws AssertionError if the actual {@code Date} month is not equal to the given month. */ public void assertHasMonth(AssertionInfo info, Date actual, int month) { assertNotNull(info, actual); if (monthOf(actual) != month) throw failures.failure(info, shouldHaveDateField(actual, "month", month)); }
/** * Verifies that the actual {@code Date} month is equal to the given month, <b>month value starting at 1</b> (January=1, * February=2, ...). * @param info contains information about the assertion. * @param actual the "actual" {@code Date}. * @param month the month to compare actual month to, see {@link Calendar#MONTH} for valid values * @throws AssertionError if {@code actual} is {@code null}. * @throws AssertionError if the actual {@code Date} month is not equal to the given month. */ public void assertHasMonth(AssertionInfo info, Date actual, int month) { assertNotNull(info, actual); if (monthOf(actual) != month) throw failures.failure(info, shouldHaveDateField(actual, "month", month)); }