SourceDSL { public static DatesDSL dates() { return new DatesDSL(); }  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 shouldThrowErrorWhenCreatingADateOfNegativeLong() { try { Gen<Date> testee = dates().withMilliseconds(-234); fail("Created a date with a negative number of milliseconds"); } catch (IllegalArgumentException expected) { assertTrue( "Expected exception message to relate to negative long argument", expected.getMessage() .indexOf( "not an accepted number of milliseconds") >= 0); } }
@SuppressWarnings("unused") @Test public void shouldNotCatchWhenCreatingADateWithLongOfZero() { try { Gen<Date> testee = dates().withMilliseconds(0); } catch (IllegalArgumentException expected) { fail("Threw an exception for an acceptable input!"); } }
@SuppressWarnings("unused") @Test public void shouldThrowErrorWhenCreatingAnInclusiveLongIntervalForDatesWithMaxLessThanMin() { try { Gen<Date> testee = dates().withMillisecondsBetween(342, 3); fail("Created a Date where max long is less than min long!"); } catch (IllegalArgumentException expected) { } }
@SuppressWarnings("unused") @Test public void shouldNotCatchWhenCreatingAnInclusiveLongIntervalForDatesWithMaxEqualToMin() { try { Gen<Date> testee = dates().withMillisecondsBetween(352, 352); } catch (IllegalArgumentException expected) { fail("Threw an exception for an acceptable interval!"); } }
@SuppressWarnings("unused") @Test public void shouldThrowErrorWhenCreatingAnInclusiveLongIntervalForDatesWithMinLessThanZero() { try { Gen<Date> testee = dates().withMillisecondsBetween(-5, 6); fail("Created a Date where min long is less than zero!"); } catch (IllegalArgumentException expected) { } }
@SuppressWarnings("unused") @Test public void shouldNotCatchWhenCreatingAnInclusiveLongIntervalForDatesWithMinEqualToZero() { try { Gen<Date> testee = dates().withMillisecondsBetween(0, 5); } catch (IllegalArgumentException expected) { fail("Threw an exception for an acceptable interval!"); } }
@Test public void shouldGenerateDateMax() { Gen<Date> testee = dates().withMilliseconds(7890789); assertThatGenerator(testee).generatesTheMinAndMax(new Date(0),new Date(7890789)); }
@Test public void shouldGenerateDateAtStartAndEndInclusive() { Gen<Date> testee = dates().withMillisecondsBetween(3245352, 72938572398752L); assertThatGenerator(testee).generatesTheMinAndMax(new Date(3245352), new Date(72938572398752L)); }