SourceDSL { public static IntegersDSL integers() { return new IntegersDSL(); }  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();  }
@Test public void shouldGenerateIntegerMaxAndMin() { Gen<Integer> testee = integers().all(); assertThatGenerator(testee).generatesTheMinAndMax(Integer.MIN_VALUE, Integer.MAX_VALUE); }
@Test public void shouldGenerateIntegerMaxAnd1() { Gen<Integer> testee = integers().allPositive(); assertThatGenerator(testee).generatesTheMinAndMax(1, Integer.MAX_VALUE); }
@Test public void shouldGenerateIntegerStartAndEndInclusive() { Gen<Integer> testee = integers().from(-87078).upToAndIncluding(8706); assertThatGenerator(testee).generatesTheMinAndMax(-87078, 8706); }
@Test public void shouldGenerateIntegerStartAndEndExclusive() { Gen<Integer> testee = integers().from(-87078).upTo(8706); assertThatGenerator(testee).generatesTheMinAndMax(-87078, 8705); }
@SuppressWarnings("unused") @Test public void shouldThrowErrorWhenCreatingAnExclusiveIntervalWithMaxLessThanMin() { try { Gen<Integer> testee = integers().from(-5).upTo(-5); fail("Created an integer generator where max is less than min!"); } catch (IllegalArgumentException expected) { assertTrue("Expected exception message to relate to improper interval", expected.getMessage() .indexOf("There are no Integer values to be generated") >= 0); } }
@SuppressWarnings("unused") @Test public void shouldNotCatchWhenCreatingAnExclusiveIntervalWithMaxOneMoreThanMin() { try { Gen<Integer> testee = integers().from(-5).upTo(-4); } catch (IllegalArgumentException expected) { fail("Threw an exception for an acceptable interval!"); } }
@SuppressWarnings("unused") @Test public void shouldThrowErrorWhenCreatingAnInclusiveIntervalWithMaxLessThanMin() { try { Gen<Integer> testee = integers().from(-5).upToAndIncluding(-6); fail("Created an integer generator where max is less than min!"); } catch (IllegalArgumentException expected) { assertTrue("Expected exception message to relate to improper interval", expected.getMessage() .indexOf("There are no Integer values to be generated") >= 0); } }
@SuppressWarnings("unused") @Test public void shouldNotCatchWhenCreatingAnInclusiveIntervalWithMaxEqualToMin() { try { Gen<Integer> testee = integers().from(-5).upToAndIncluding(-5); } catch (IllegalArgumentException expected) { fail("Threw an exception for an acceptable interval!"); } }
@SuppressWarnings("unused") @Test public void shouldThrowErrorWhenCreatingAnInclusiveIntervalWithBetweenWithMaxLessThanMin() { try { Gen<Integer> testee = integers().between(-5, -6); fail("Created an integer generator where max is less than min!"); } catch (IllegalArgumentException expected) { assertTrue("Expected exception message to relate to improper interval", expected.getMessage() .indexOf("There are no Integer values to be generated") >= 0); } }
@SuppressWarnings("unused") @Test public void shouldNotCatchWhenCreatingAnInclusiveIntervalWithBetweenWithMaxEqualToMin() { try { Gen<Integer> testee = integers().between(-5, -5); } catch (IllegalArgumentException expected) { fail("Threw an exception for an acceptable interval!"); } }