/** Tests the 4-move solution to the water jug problem */ @Test public void testSolution1() { assertFalse(problem.success()); tryMove(m1); assertFalse(problem.success()); tryMove(m5); assertFalse(problem.success()); tryMove(m1); assertFalse(problem.success()); tryMove(m5); assertTrue(problem.success()); }
/** Tests the 6-move solution to the water jug problem */ @Test public void testSolution2() { assertFalse(problem.success()); tryMove(m2); assertFalse(problem.success()); tryMove(m6); assertFalse(problem.success()); tryMove(m3); assertFalse(problem.success()); tryMove(m6); assertFalse(problem.success()); tryMove(m2); assertFalse(problem.success()); tryMove(m6); assertTrue(problem.success()); }