/** * Verifies that the actual {@code Date} is in [start, end[ period (start included, end excluded). * <p> * Example: * <pre><code class='java'> // assertion will pass * // theTwoTowers release date : 2002-12-18 * assertThat(theTwoTowers.getReleaseDate()).isBetween(theFellowshipOfTheRing.getReleaseDate(), theReturnOfTheKing.getReleaseDate()); * * // assertion will fail * assertThat(theFellowshipOfTheRing.getReleaseDate()).isBetween(theTwoTowers.getReleaseDate(), theReturnOfTheKing.getReleaseDate());</code></pre> * * @param start the period start (inclusive), expected not to be null. * @param end the period end (exclusive), expected not to be null. * @return this assertion object. * @throws AssertionError if the actual {@code Date} is {@code null}. * @throws NullPointerException if start {@code Date} is {@code null}. * @throws NullPointerException if end {@code Date} is {@code null}. * @throws AssertionError if the actual {@code Date} is not in [start, end[ period. */ public SELF isBetween(Date start, Date end) { return isBetween(start, end, true, false); }
/** * Verifies that the actual {@code Date} is in [start, end[ period (start included, end excluded). * <p> * Example: * <pre><code class='java'> // assertion will pass * // theTwoTowers release date : 2002-12-18 * assertThat(theTwoTowers.getReleaseDate()).isBetween(theFellowshipOfTheRing.getReleaseDate(), theReturnOfTheKing.getReleaseDate()); * * // assertion will fail * assertThat(theFellowshipOfTheRing.getReleaseDate()).isBetween(theTwoTowers.getReleaseDate(), theReturnOfTheKing.getReleaseDate());</code></pre> * * @param start the period start (inclusive), expected not to be null. * @param end the period end (exclusive), expected not to be null. * @return this assertion object. * @throws AssertionError if the actual {@code Date} is {@code null}. * @throws NullPointerException if start {@code Date} is {@code null}. * @throws NullPointerException if end {@code Date} is {@code null}. * @throws AssertionError if the actual {@code Date} is not in [start, end[ period. */ public SELF isBetween(Date start, Date end) { return isBetween(start, end, true, false); }
return isBetween(parse(start), parse(end));
return isBetween(parse(start), parse(end));
/** * Verifies that the actual {@code Date} is in [start, end[ period (start included, end excluded). * <p/> * Example: * * <pre><code class='java'> * // assertion will pass * assertThat(theTwoTowers.getReleaseDate()).isBetween(theFellowshipOfTheRing.getReleaseDate(), * theReturnOfTheKing.getReleaseDate()); * * // assertion will fail * assertThat(theFellowshipOfTheRing.getReleaseDate()).isBetween(theTwoTowers.getReleaseDate(), * theReturnOfTheKing.getReleaseDate()); * </code></pre> * * @param start the period start (inclusive), expected not to be null. * @param end the period end (exclusive), expected not to be null. * @return this assertion object. * @throws AssertionError if the actual {@code Date} is {@code null}. * @throws NullPointerException if start {@code Date} is {@code null}. * @throws NullPointerException if end {@code Date} is {@code null}. * @throws AssertionError if the actual {@code Date} is not in [start, end[ period. */ public S isBetween(Date start, Date end) { return isBetween(start, end, true, false); }
return isBetween(parse(start), parse(end));