/** * Verifies that the actual {@code Date} day of week is equal to the given day of week. * @param info contains information about the assertion. * @param actual the "actual" {@code Date}. * @param dayOfWeek the day of week to compare actual day of week to, see {@link Calendar#DAY_OF_WEEK} for valid values * @throws AssertionError if {@code actual} is {@code null}. * @throws AssertionError if the actual {@code Date} week is not equal to the given day of week. */ public void assertHasDayOfWeek(AssertionInfo info, Date actual, int dayOfWeek) { assertNotNull(info, actual); if (dayOfWeekOf(actual) != dayOfWeek) throw failures.failure(info, shouldHaveDateField(actual, "day of week", dayOfWeek)); }
/** * Verifies that the actual {@code Date} day of week is equal to the given day of week. * @param info contains information about the assertion. * @param actual the "actual" {@code Date}. * @param dayOfWeek the day of week to compare actual day of week to, see {@link Calendar#DAY_OF_WEEK} for valid values * @throws AssertionError if {@code actual} is {@code null}. * @throws AssertionError if the actual {@code Date} week is not equal to the given day of week. */ public void assertHasDayOfWeek(AssertionInfo info, Date actual, int dayOfWeek) { assertNotNull(info, actual); if (dayOfWeekOf(actual) != dayOfWeek) throw failures.failure(info, shouldHaveDateField(actual, "day of week", dayOfWeek)); }