public abstract class IsSameOrBefore extends Object
| Constructor and Description |
|---|
IsSameOrBefore() |
| Modifier and Type | Method and Description |
|---|---|
static org.hamcrest.Matcher<Date> |
sameOrBefore(Date date)
Creates a matcher that matches when the examined date is at the same instant or before the reference date
For example:
|
static org.hamcrest.Matcher<Date> |
sameOrBefore(DayMonthYear date)
Creates a matcher that matches when the examined date is at the same instant or before the reference date
For example:
|
static org.hamcrest.Matcher<Date> |
sameOrBefore(int year,
Months month,
int day)
Creates a matcher that matches when the examined date is on the same day or before the start of the reference date
For example:
|
static org.hamcrest.Matcher<Date> |
sameOrBefore(int year,
Months month,
int date,
int hour,
int minute,
int second)
Creates a matcher that matches when the examined date is on the same second or before the start of the reference date and time
For example:
|
public static org.hamcrest.Matcher<Date> sameOrBefore(Date date)
assertThat(myDate, isSameOrBefore(new Date()))
date - the reference date against which the examined date is checkedpublic static org.hamcrest.Matcher<Date> sameOrBefore(DayMonthYear date)
assertThat(myDate, isSameOrBefore(Moments.today()));
date - the reference date against which the examined date is checkedpublic static org.hamcrest.Matcher<Date> sameOrBefore(int year, Months month, int day)
assertThat(myDate, isSameOrBefore(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> sameOrBefore(int year, Months month, int date, int hour, int minute, int second)
assertThat(myDate, isSameOrBefore(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.