SourceDSL { public static LocalDatesDSL localDates() { return new LocalDatesDSL(); }  static LongsDSL longs(); static IntegersDSL integers(); static DoublesDSL doubles(); static FloatsDSL floats(); static CharactersDSL characters(); static StringsDSL strings(); static ListsDSL lists(); static MapsDSL maps(); static ArraysDSL arrays(); static BigIntegersDSL bigIntegers(); static BigDecimalsDSL bigDecimals(); static ArbitraryDSL arbitrary(); static DatesDSL dates(); static LocalDatesDSL localDates(); static BooleansDSL booleans();  }
@SuppressWarnings("unused") @Test public void shouldThrowErrorWhenCreatingALocalDateBelowMinEpochDayCount() { try { Gen<LocalDate> testee = localDates() .withDays(LOCAL_DATE_MIN_EPOCH_DAY_COUNT - 1); fail("Created a localDate with an improper value"); } catch (IllegalArgumentException expected) { assertTrue( "Expected exception message to relate to out of suitable range long argument", expected.getMessage() .indexOf( "The long value representing the number of days from the epoch must be bounded") >= 0); } }
@SuppressWarnings("unused") @Test public void shouldThrowErrorWhenCreatingALocalDateAboveMaxEpochDayCount() { try { Gen<LocalDate> testee = localDates() .withDays(LOCAL_DATE_MAX_EPOCH_DAY_COUNT + 1); fail("Created a localDate with an improper value"); } catch (IllegalArgumentException expected) { } }
@SuppressWarnings("unused") @Test public void shouldNotCatchWhenCreatingALocalDateAtMinEpochDayCount() { try { Gen<LocalDate> testee = localDates() .withDays(LOCAL_DATE_MIN_EPOCH_DAY_COUNT); } catch (IllegalArgumentException expected) { fail("Threw an exception for an acceptable input!"); } }
@SuppressWarnings("unused") @Test public void shouldNotCatchWhenCreatingALocalDateAtMaxEpochDayCount() { try { Gen<LocalDate> testee = localDates() .withDays(LOCAL_DATE_MAX_EPOCH_DAY_COUNT); } catch (IllegalArgumentException expected) { fail("Threw an exception for an acceptable input!"); } }
@SuppressWarnings("unused") @Test public void shouldThrowErrorWhenCreatingAnInclusiveLongIntervalForLocalDatesWithMaxLessThanMin() { try { Gen<LocalDate> testee = localDates().withDaysBetween(342, 3); fail("Created a localDate where max long is less than min long!"); } catch (IllegalArgumentException expected) { } }
@SuppressWarnings("unused") @Test public void shouldNotCatchWhenCreatingAnInclusiveLongIntervalForLocalDatesWithMaxEqualToMin() { try { Gen<LocalDate> testee = localDates().withDaysBetween(352, 352); } catch (IllegalArgumentException expected) { fail("Threw an exception for an acceptable interval!"); } }
@SuppressWarnings("unused") @Test public void shouldThrowErrorWhenCreatingAnInclusiveLongIntervalForLocalDatesWithMinLessThanMinEpochDayCount() { try { Gen<LocalDate> testee = localDates().withDaysBetween( LOCAL_DATE_MIN_EPOCH_DAY_COUNT - 1, LOCAL_DATE_MAX_EPOCH_DAY_COUNT + 1); fail("Created a Date where min long is less than zero!"); } catch (IllegalArgumentException expected) { } }
@SuppressWarnings("unused") @Test public void shouldNotCatchWhenCreatingAnInclusiveLongIntervalForDatesWithMinEqualToMinEpochDayCount() { try { Gen<LocalDate> testee = localDates().withDaysBetween( LOCAL_DATE_MIN_EPOCH_DAY_COUNT, LOCAL_DATE_MAX_EPOCH_DAY_COUNT); } catch (IllegalArgumentException expected) { fail("Threw an exception for an acceptable interval!"); } }
@Test public void shouldGenerateLocalDateMax() { Gen<LocalDate> testee = localDates().withDays(7890789); assertThatGenerator(testee).generatesTheMinAndMax(LocalDate.ofEpochDay(0),LocalDate.ofEpochDay(7890789)); }
@Test public void shouldGenerateLocalDateAtStartAndEndInclusive() { Gen<LocalDate> testee = localDates().withDaysBetween(3245352, 729385723); assertThatGenerator(testee).generatesTheMinAndMax(LocalDate.ofEpochDay(3245352), LocalDate.ofEpochDay(729385723)); }