/** * Returns true if both date are in the same year, month and day of 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, month and day of month, false otherwise */ private static boolean areInSameDayOfMonth(Date actual, Date other) { return areInSameMonth(actual, other) && dayOfMonthOf(actual) == dayOfMonthOf(other); }
/** * Returns true if both date are in the same year, month and day of 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, month and day of month, false otherwise */ private static boolean areInSameDayOfMonth(Date actual, Date other) { return areInSameMonth(actual, other) && dayOfMonthOf(actual) == dayOfMonthOf(other); }
/** * Verifies that the actual {@code Date} day of month is equal to the given day of month. * @param info contains information about the assertion. * @param actual the "actual" {@code Date}. * @param dayOfMonth the day of month to compare actual day of month to * @throws AssertionError if {@code actual} is {@code null}. * @throws AssertionError if the actual {@code Date} month is not equal to the given day of month. */ public void assertHasDayOfMonth(AssertionInfo info, Date actual, int dayOfMonth) { assertNotNull(info, actual); if (dayOfMonthOf(actual) != dayOfMonth) throw failures.failure(info, shouldHaveDateField(actual, "day of month", dayOfMonth)); }
/** * Verifies that the actual {@code Date} day of month is equal to the given day of month. * @param info contains information about the assertion. * @param actual the "actual" {@code Date}. * @param dayOfMonth the day of month to compare actual day of month to * @throws AssertionError if {@code actual} is {@code null}. * @throws AssertionError if the actual {@code Date} month is not equal to the given day of month. */ public void assertHasDayOfMonth(AssertionInfo info, Date actual, int dayOfMonth) { assertNotNull(info, actual); if (dayOfMonthOf(actual) != dayOfMonth) throw failures.failure(info, shouldHaveDateField(actual, "day of month", dayOfMonth)); }