.thenReturn(0);
when(constraint.value()).thenReturn("#_ > 0");
}
@Test public void whenDiscardRatioExceededEvenWithSomeSuccesses() {
ParameterContext parameter = new ParameterContext(int.class);
parameter.addQuantifier(quantifier);
parameter.addConstraint(constraint);
GenerationContext generation =
new GenerationContext(parameter, new GeneratorRepository(random).register(generator));
thrown.expect(GenerationContext.DiscardRatioExceededException.class);
thrown.expectMessage(String.format(
GenerationContext.DiscardRatioExceededException.MESSAGE_TEMPLATE,
parameter.discardRatio(),
30,
10,
3D));
while (generation.shouldContinue())