public void HoleIteratorTest() { Solver solver = new Solver("TestConstraint"); IntVar x = solver.MakeIntVar(0, 10, "x"); RemoveThreeValues ct = new RemoveThreeValues(solver, x); solver.Add(ct); DecisionBuilder db = solver.MakePhase(x, Solver.CHOOSE_FIRST_UNBOUND, Solver.ASSIGN_MIN_VALUE); solver.Solve(db); Assert.Equal(3, ct.count()); }
static void HoleIteratorTest() { Solver solver = new Solver("TestConstraint"); IntVar x = solver.MakeIntVar(0, 10, "x"); RemoveThreeValues ct = new RemoveThreeValues(solver, x); solver.Add(ct); DecisionBuilder db = solver.MakePhase(x, Solver.CHOOSE_FIRST_UNBOUND, Solver.ASSIGN_MIN_VALUE); solver.Solve(db); CheckLongEq(3, ct.count(), "Something went wrong, either in the " + "GetHoles() iterator, or the WhenDomain() demon invocation."); }