Uses of Class
org.fest.assertions.api.DateAssert
Packages that use DateAssert
-
Uses of DateAssert in org.fest.assertions.api
Methods in org.fest.assertions.api that return DateAssertModifier and TypeMethodDescriptionstatic DateAssert
Assertions.assertThat
(Date actual) Creates a new instance of
.DateAssert
DateAssert.hasTime
(long timestamp) Verifies that the actualDate
has the same time as the given timestamp.Same assertion asisAfter(Date)
but given Date is represented as String either with ISO date format (yyyy-MM-dd) or user custom date format (set with methodwithDateFormat(DateFormat)
).Verifies that the actualDate
is strictly after the given one.DateAssert.isAfterOrEqualsTo
(String dateAsString) Same assertion asisAfterOrEqualsTo(Date)
but given Date is represented as String either with ISO date format (yyyy-MM-dd) or user custom date format (set with methodwithDateFormat(DateFormat)
).DateAssert.isAfterOrEqualsTo
(Date other) Verifies that the actualDate
is after or equals to the given one.DateAssert.isAfterYear
(int year) Verifies that the actualDate
is strictly after the given year.Same assertion asisBefore(Date)
but given Date is represented as String either with ISO date format (yyyy-MM-dd) or user custom date format (set with methodwithDateFormat(DateFormat)
).Verifies that the actualDate
is strictly before the given one.DateAssert.isBeforeOrEqualsTo
(String dateAsString) Same assertion asisBeforeOrEqualsTo(Date)
but given Date is represented as String either with ISO date format (yyyy-MM-dd) or user custom date format (set with methodwithDateFormat(DateFormat)
).DateAssert.isBeforeOrEqualsTo
(Date other) Verifies that the actualDate
is before or equals to the given one.DateAssert.isBeforeYear
(int year) Verifies that the actualDate
is strictly before the given year.Same assertion asisBetween(Date, Date)
but given Dates are represented as String either with ISO date format (yyyy-MM-dd) or user custom date format (set with methodwithDateFormat(DateFormat)
).Same assertion asisBetween(Date, Date, boolean, boolean)
but given Dates are represented as String either with ISO date format (yyyy-MM-dd) or user custom date format (set with methodwithDateFormat(DateFormat)
).Verifies that the actualDate
is in [start, end[ period (start included, end excluded).Verifies that the actualDate
is in the given period defined by start and end dates.
To include start in the period set inclusiveStart parameter totrue
.
To include end in the period set inclusiveEnd parameter totrue
.Same assertion asisCloseTo(Date, long)
but given Date is represented as String either with ISO date format (yyyy-MM-dd) or user custom date format (set with methodwithDateFormat(DateFormat)
).Verifies that the actualDate
is close to the other date by less than delta (expressed in milliseconds), if difference is equals to delta it's ok.Same assertion asisEqualTo(Date date)
but given Date is represented as String either with ISO date format (yyyy-MM-dd) or user custom date format (set with methodwithDateFormat(DateFormat)
).Same assertion asAssert.isIn(Object...)
but given Dates are represented as String either with ISO date format (yyyy-MM-dd) or user custom date format (set with methodwithDateFormat(DateFormat)
).DateAssert.isInSameDayAs
(String dateAsString) Same assertion asisInSameDayAs(Date)
but given Date is represented as String either with ISO date format (yyyy-MM-dd) or user custom date format (set with methodwithDateFormat(DateFormat)
).DateAssert.isInSameDayAs
(Date other) Verifies that actual and givenDate
are chronologically in the same day of month (and thus in the same month and year).DateAssert.isInSameHourAs
(String dateAsString) Same assertion asisInSameHourAs(Date)
but given Date is represented as String either with ISO date format (yyyy-MM-dd) or user custom date format (set with methodwithDateFormat(DateFormat)
).DateAssert.isInSameHourAs
(Date other) Verifies that actual and givenDate
are chronologically in the same hour (and thus in the same day, month and year).DateAssert.isInSameMinuteAs
(String dateAsString) Same assertion asisInSameMinuteAs(Date)
but given Date is represented as String either with ISO date format (yyyy-MM-dd) or user custom date format (set with methodwithDateFormat(DateFormat)
).DateAssert.isInSameMinuteAs
(Date other) Verifies that actual and givenDate
are chronologically in the same minute (and thus in the same hour, day, month and year).DateAssert.isInSameMonthAs
(String dateAsString) Same assertion asisInSameMonthAs(Date)
but given Date is represented as String either with ISO date format (yyyy-MM-dd) or user custom date format (set with methodwithDateFormat(DateFormat)
).DateAssert.isInSameMonthAs
(Date other) Verifies that actual and givenDate
are chronologically in the same month (and thus in the same year).DateAssert.isInSameSecondAs
(String dateAsString) Same assertion asisInSameSecondAs(Date)
but given Date is represented as String either with ISO date format (yyyy-MM-dd) or user custom date format (set with methodwithDateFormat(DateFormat)
).DateAssert.isInSameSecondAs
(Date other) Verifies that actual and givenDate
are chronologically in the same second (and thus in the same minute, hour, day, month and year).DateAssert.isInSameYearAs
(String dateAsString) Same assertion asisInSameYearAs(Date)
but given Date is represented as String either with ISO date format (yyyy-MM-dd) or user custom date format (set with methodwithDateFormat(DateFormat)
).DateAssert.isInSameYearAs
(Date other) Verifies that actual and givenDate
are in the same year.DateAssert.isInTheFuture()
Verifies that the actualDate
is strictly in the future.DateAssert.isInThePast()
Verifies that the actualDate
is strictly in the past.DateAssert.isInWithStringDateCollection
(Collection<String> datesAsString) Same assertion asAssert.isIn(Iterable)
but given Dates are represented as String either with ISO date format (yyyy-MM-dd) or user custom date format (set with methodwithDateFormat(DateFormat)
).
Method signature could not beisIn(Collection<String>)
because it would be same signature asisIn(Collection<Date>)
since java collection type are erased at runtime.DateAssert.isNotBetween
(String start, String end) Same assertion asisNotBetween(Date, Date)
but given Dates are represented as String either with ISO date format (yyyy-MM-dd) or user custom date format (set with methodwithDateFormat(DateFormat)
).DateAssert.isNotBetween
(String start, String end, boolean inclusiveStart, boolean inclusiveEnd) Same assertion asisNotBetween(Date, Date, boolean, boolean)
but given Dates are represented as String either with ISO date format (yyyy-MM-dd) or user custom date format (set with methodwithDateFormat(DateFormat)
).DateAssert.isNotBetween
(Date start, Date end) Verifies that the actualDate
is not in [start, end[ periodDateAssert.isNotBetween
(Date start, Date end, boolean inclusiveStart, boolean inclusiveEnd) Verifies that the actualDate
is not in the given period defined by start and end dates.
To include start in the period set inclusiveStart parameter totrue
.
To include end in the period set inclusiveEnd parameter totrue
.DateAssert.isNotEqualTo
(String dateAsString) Same assertion asisNotEqualTo(Date date)
but given Date is represented as String either with ISO date format (yyyy-MM-dd) or user custom date format (set with methodwithDateFormat(DateFormat)
).Same assertion asAssert.isNotIn(Object...)
but given Dates are represented as String either with ISO date format (yyyy-MM-dd) or user custom date format (set with methodwithDateFormat(DateFormat)
).DateAssert.isNotInWithStringDateCollection
(Collection<String> datesAsString) Same assertion asAssert.isNotIn(Iterable)
but given Dates are represented as String either with ISO date format (yyyy-MM-dd) or user custom date format (set with methodwithDateFormat(DateFormat)
).
Method signature could not beisNotIn(Collection<String>)
because it would be same signature asisNotIn(Collection<Date>)
since java collection type are erased at runtime.DateAssert.isToday()
Verifies that the actualDate
is today, that is matching current year, month and day (no check on hour, minute, second, milliseconds).DateAssert.isWithinDayOfMonth
(int dayOfMonth) Verifies that the actualDate
day of month is equal to the given day of month.DateAssert.isWithinDayOfWeek
(int dayOfWeek) Verifies that the actualDate
day of week is equal to the given day of week (seeCalendar.DAY_OF_WEEK
for valid values).DateAssert.isWithinHourOfDay
(int hourOfDay) Verifies that the actualDate
hour od day is equal to the given hour of day (24-hour clock).DateAssert.isWithinMillisecond
(int millisecond) Verifies that the actualDate
millisecond is equal to the given millisecond.DateAssert.isWithinMinute
(int minute) Verifies that the actualDate
minute is equal to the given minute.DateAssert.isWithinMonth
(int month) Verifies that the actualDate
month is equal to the given month, month value starting at 1 (January=1, February=2, ...).DateAssert.isWithinSecond
(int second) Verifies that the actualDate
second is equal to the given second.DateAssert.isWithinYear
(int year) Verifies that the actualDate
year is equal to the given year.DateAssert.usingComparator
(Comparator<? super Date> customComparator) DateAssert.usingDefaultComparator()
DateAssert.withDateFormat
(DateFormat userCustomDateFormat) For String based Date assertions likeisBefore(String)
, given String is expected to follow the default Date format, that is ISO 8601 format : "yyyy-MM-dd".DateAssert.withIsoDateFormat()
Use ISO 8601 date format ("yyyy-MM-dd") for String based Date assertions.