| Constructor and Description |
|---|
IsSameHour(Date date) |
IsSameHour(int hour) |
| 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> |
sameHour(Date date)
Creates a matcher that matches when the examined date is on the same hour as the reference date
For example:
|
static org.hamcrest.Matcher<Date> |
sameHour(int hour)
Creates a matcher that matches when the examined date is on the same hour as the reference date
For example:
|
public IsSameHour(Date date)
public IsSameHour(int hour)
public static org.hamcrest.Matcher<Date> sameHour(Date date)
assertThat(myDate, sameHour(new Date()))
date - the reference date against which the examined date is checkedpublic static org.hamcrest.Matcher<Date> sameHour(int hour)
assertThat(myDate, sameHour(12));
hour - the reference hour 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.