| Modifier and Type | Method and Description |
|---|---|
static org.hamcrest.Matcher<Date> |
before(Date date)
Creates a matcher that matches when the examined date is before the reference date
For example:
|
static org.hamcrest.Matcher<Date> |
before(DayMonthYear date)
Creates a matcher that matches when the examined date is before the reference date
For example:
|
static org.hamcrest.Matcher<Date> |
before(int year,
Months month,
int day)
Creates a matcher that matches when the examined date is before the start of the reference date
For example:
|
static org.hamcrest.Matcher<Date> |
before(int year,
Months month,
int date,
int hour,
int minute,
int second)
Creates a matcher that matches when the examined date is before the start of the reference date and time
For example:
|
void |
describeTo(org.hamcrest.Description description) |
protected boolean |
matchesSafely(Date actual,
org.hamcrest.Description mismatchDesc) |
public IsBefore(Date expected)
protected boolean matchesSafely(Date actual, org.hamcrest.Description mismatchDesc)
matchesSafely in class org.hamcrest.TypeSafeDiagnosingMatcher<Date>public void describeTo(org.hamcrest.Description description)
public static org.hamcrest.Matcher<Date> before(Date date)
assertThat(myDate, before(new Date()))
date - the reference date against which the examined date is checkedpublic static org.hamcrest.Matcher<Date> before(DayMonthYear date)
assertThat(myDate, before(Moments.today()));
date - the reference date against which the examined date is checkedpublic static org.hamcrest.Matcher<Date> before(int year, Months month, int day)
assertThat(myDate, before(2012, Months.MAY, 12));
year - the year against which the examined date is checkedmonth - the month against which the examined date is checkedday - the day of the month against which the examined date is checkedpublic static org.hamcrest.Matcher<Date> before(int year, Months month, int date, int hour, int minute, int second)
assertThat(myDate, before(2012, Months.MAY, 12, 23, 00, 01));
year - the year against which the examined date is checkedmonth - the month against which the examined date is checkedday - the day of the month against which the examined date is checkedhour - the hour of the day against which the examined date is checkedminute - the minute of the hour against which the examined date is checkedsecond - the second of the minute against which the examined date is checkedCopyright © 2014. All Rights Reserved.