Refine search
@Test public void primitiveBytes() throws Exception { assertThat(testResult(PrimitiveBytes.class), isSuccessful()); assertEquals(2, PrimitiveBytes.iterations); assertEquals( new HashSet<>(asList(Byte.valueOf("12"), Byte.valueOf("-13"))), PrimitiveBytes.testCases); }
@Test public void wrapperBytes() throws Exception { assertThat(testResult(WrapperBytes.class), isSuccessful()); assertEquals(2, WrapperBytes.iterations); assertEquals( new HashSet<>(asList(Byte.valueOf("14"), Byte.valueOf("-15"))), WrapperBytes.testCases); }
@Test public void primitiveChars() throws Exception { assertThat(testResult(PrimitiveChars.class), isSuccessful()); assertEquals(2, PrimitiveChars.iterations); assertEquals( new HashSet<>(asList('Z', 'z')), PrimitiveChars.testCases); }
@Test public void wrapperFloats() throws Exception { assertThat(testResult(WrapperFloats.class), isSuccessful()); assertEquals(2, WrapperFloats.iterations); assertEquals( new HashSet<>(asList(1.7F, -4.14F)), WrapperFloats.testCases); }
@Test public void primitiveIntegers() throws Exception { assertThat(testResult(PrimitiveIntegers.class), isSuccessful()); assertEquals(3, PrimitiveIntegers.iterations); assertEquals( new HashSet<>(asList(1, 2, 3)), PrimitiveIntegers.testCases); }
@Test public void strings() throws Exception { assertThat(testResult(Strings.class), isSuccessful()); assertEquals(2, Strings.iterations); assertEquals( new HashSet<>(asList("some", "values")), Strings.testCases); }
@Test public void noImplicitConversion() throws Exception { assertThat( testResult(NoImplicitConversion.class), hasSingleFailureContaining(ReflectionException.class.getName())); assertEquals(0, NoImplicitConversion.iterations); }
@Test public void trialCountHoldsForEntirePropertyRatherThanIndividualParameters() { assertThat(testResult(ForValuesOfMultipleParameters.class), isSuccessful()); assertEquals(4, ForValuesOfMultipleParameters.iterations); List<Foo> foos = ForValuesOfMultipleParameters.foos; assertEquals(8, foos.size()); assertEquals(foos.get(0), foos.get(4)); assertEquals(foos.get(1), foos.get(3)); assertEquals(foos.get(2), foos.get(6)); assertEquals(foos.get(5), foos.get(7)); }
@Test public void shrinkingPrimitivePositiveByte() { assertThat(testResult(ShrinkingPrimitivePositiveByte.class), failureCountIs(1)); assertEquals( Byte.valueOf("3"), Iterables.getLast(ShrinkingPrimitivePositiveByte.values)); }
@Test public void shrinkingPrimitiveNegativeByte() { assertThat(testResult(ShrinkingPrimitiveNegativeByte.class), failureCountIs(1)); assertEquals( Byte.valueOf("-13"), Iterables.getLast(ShrinkingPrimitiveNegativeByte.values)); }
@Test public void shrinkingPrimitivePositiveFloat() { assertThat(testResult(ShrinkingPrimitivePositiveFloat.class), failureCountIs(1)); assertEquals( Float.valueOf(5.123123F), Iterables.getLast(ShrinkingPrimitivePositiveFloat.values)); }
@Test public void shrinkingPrimitiveNegativeInteger() { assertThat(testResult(ShrinkingPrimitiveNegativeInteger.class), failureCountIs(1)); assertEquals( Integer.valueOf(-7), Iterables.getLast(ShrinkingPrimitiveNegativeInteger.values)); }
@Test public void shrinkingPrimitiveLongStraddlingZero() { assertThat(testResult(ShrinkingPrimitiveLongStraddlingZero.class), failureCountIs(1)); assertEquals( Long.valueOf(0), Iterables.getLast(ShrinkingPrimitiveLongStraddlingZero.values)); }
@Test public void noImplicitConversion() throws Exception { assertThat( testResult(NoImplicitConversion.class), hasSingleFailureContaining(ReflectionException.class.getName())); assertEquals(0, NoImplicitConversion.iterations); }
@Test public void manyParameters() throws Exception { assertThat(testResult(ManyParameters.class), isSuccessful()); assertEquals(10, ManyParameters.iterations); assertEquals( new HashSet<>(asList(-1, -2, -4)), new HashSet<>(ManyParameters.firstValues.subList(0, 3))); assertEquals( new HashSet<>(asList('r', 'y')), new HashSet<>(ManyParameters.secondValues.subList(0, 2))); }
@Test public void negativeRatioWillNeverGenerateValues() { assertThat( testResult(NegativeDiscardRatio.class), hasFailureContaining(IllegalArgumentException.class.getName())); assertEquals(0, NegativeDiscardRatio.iterations); }
@Test public void primitiveBooleans() throws Exception { assertThat(testResult(PrimitiveBooleans.class), isSuccessful()); assertEquals(1, PrimitiveBooleans.iterations); assertEquals(singleton(true), PrimitiveBooleans.testCases); }
@Test public void wrapperIntegers() throws Exception { assertThat(testResult(WrapperIntegers.class), isSuccessful()); assertEquals(2, WrapperIntegers.iterations); assertEquals( new HashSet<>(asList(4, 5)), WrapperIntegers.testCases); }
@Test public void primitiveLongs() throws Exception { assertThat(testResult(PrimitiveLongs.class), isSuccessful()); assertEquals(3, PrimitiveLongs.iterations); assertEquals( new HashSet<>(asList(-6L, -7L, -8L)), PrimitiveLongs.testCases); }
@Test public void wrapperShorts() throws Exception { assertThat(testResult(WrapperShorts.class), isSuccessful()); assertEquals(2, WrapperShorts.iterations); assertEquals( new HashSet<>(asList(Short.valueOf("-13"), Short.valueOf("-14"))), WrapperShorts.testCases); }