| Modifier and Type | Method and Description |
|---|---|
void |
describeTo(org.hamcrest.Description description) |
protected boolean |
matchesSafely(Date actual,
org.hamcrest.Description mismatchDesc) |
static org.hamcrest.Matcher<Date> |
sameDay(Date date)
Creates a matcher that matches when the examined date is on the same day of the year as the reference date in the default timezone
For example:
|
static org.hamcrest.Matcher<Date> |
sameDay(DayMonthYear date)
Creates a matcher that matches when the examined date is on the same day of the year as the reference date in the default timezone
For example:
|
static org.hamcrest.Matcher<Date> |
sameDay(int year,
Months month,
int day)
Creates a matcher that matches when the examined date is on the same day of the year as the reference date
For example:
|
public IsSameDay(Date date)
public static org.hamcrest.Matcher<Date> sameDay(Date date)
assertThat(myDate, sameDayOfTheYear(new Date()))
date - the reference date against which the examined date is checkedpublic static org.hamcrest.Matcher<Date> sameDay(DayMonthYear date)
assertThat(myDate, sameDayOfTheYear(Moments.today()))
date - the reference date against which the examined date is checkedpublic static org.hamcrest.Matcher<Date> sameDay(int year, Months month, int day)
assertThat(myDate, sameDayOfTheYear(2012, Month.JAN, 1))
day - the reference day of the month against which the examined date is checkedmonth - the reference month against which the examined date is checkedyear - the reference year against which the examined date is checkedprotected boolean matchesSafely(Date actual, org.hamcrest.Description mismatchDesc)
matchesSafely in class org.hamcrest.TypeSafeDiagnosingMatcher<Date>public void describeTo(org.hamcrest.Description description)
Copyright © 2014. All Rights Reserved.