public void testIsFulfilled() throws StopConditionException, GeneratorException, InterruptedException { ModelBasedTesting mbt = ModelBasedTesting.getInstance(); mbt.setGraph(graph); mbt.setGenerator(new RandomPathGenerator(new EdgeCoverage())); assertTrue(mbt.hasNextStep()); assertEquals(false, mbt.getGenerator().getStopCondition().isFulfilled()); mbt.getNextStep(); assertEquals(false, mbt.getGenerator().getStopCondition().isFulfilled()); mbt.getNextStep(); assertEquals(true, mbt.getGenerator().getStopCondition().isFulfilled()); }
public void testFulfillment() throws StopConditionException, GeneratorException, InterruptedException { ModelBasedTesting mbt = ModelBasedTesting.getInstance(); mbt.setGraph(graph); mbt.setGenerator(new RandomPathGenerator(new EdgeCoverage())); assertTrue(mbt.hasNextStep()); assertEquals((double) 0 / 2, mbt.getGenerator().getStopCondition().getFulfilment(), 0.01); mbt.getNextStep(); assertEquals((double) 1 / 2, mbt.getGenerator().getStopCondition().getFulfilment(), 0.01); mbt.getNextStep(); assertEquals((double) 2 / 2, mbt.getGenerator().getStopCondition().getFulfilment(), 0.01); }