public class PrototypeDateExpectation extends PrototypeComparableExpectation<Date>
| Constructor and Description |
|---|
PrototypeDateExpectation(Prototype<?> prototype,
PrototypeValue property) |
| Modifier and Type | Method and Description |
|---|---|
void |
isAfter(Date date)
Set an expectation that the property value is after a given date.
|
void |
isBefore(Date date)
Set an expectation that the property value is before a given date.
|
void |
isSameDay(Date date)
Set an expectation that the property value is on the same day.
|
void |
isWithin(int interval,
TimeUnit unit,
Date date)
Set an expectation that the property value is within a given interval of the given date.
|
isComparableTohasExpectation, isEqualTo, isInstanceOf, isNotEqualTo, isNotNull, isNull, isOneOf, isOneOf, matchespublic PrototypeDateExpectation(Prototype<?> prototype, PrototypeValue property)
public void isWithin(int interval,
TimeUnit unit,
Date date)
MyObject expected = prototype(MyObject.class); expect(expected.aDate()).isWithin(1, TimeUnit.MINUTES, new Date()); expectThat(actual).matches(expected);
interval - the interval gap between the property value and the dateunit - the time unit of the intervaldate - the date to test the value againstpublic void isSameDay(Date date)
MyObject expected = prototype(MyObject.class); expect(expected.aDate()).isSameDay(new Date()); expectThat(actual).matches(expected);
date - the date to test the value againstpublic void isAfter(Date date)
MyObject expected = prototype(MyObject.class); expect(expected.aDate()).isAfter(new Date()); expectThat(actual).matches(expected);
date - the date to test the value againstpublic void isBefore(Date date)
MyObject expected = prototype(MyObject.class); expect(expected.aDate()).isBefore(new Date()); expectThat(actual).matches(expected);
date - the date to test the value againstCopyright © 2015. All rights reserved.