class TestConstraint2(unittest.TestCase): """ `TestConstraint2()` class is unit-testing the class Constraint(). """ # /////////////////////////////////////////////////// def setUp(self): params = {} params["m"] = 4 params["n"] = 4 params["pieces"] = [3, 3, 4, 4, 4, 4] self.game = Constraint(params) # /////////////////////////////////////////////////// def solve(self): """Tests validity of solution""" self.game.search(0) self.assertEqual(self.game.count == 8, True)
class TestConstraint1(unittest.TestCase): """ `TestConstraint1()` class is unit-testing the class Constraint(). """ # /////////////////////////////////////////////////// def setUp(self): params = {} params["m"] = 3 params["n"] = 3 params["pieces"] = [0, 0, 3] self.game = Constraint(params) # /////////////////////////////////////////////////// def solve(self): """Tests validity of solution""" self.game.search(0) self.assertEqual(self.game.count == 4, True)
def setUp(self): params = {} params["m"] = 4 params["n"] = 4 params["pieces"] = [3, 3, 4, 4, 4, 4] self.game = Constraint(params)
def setUp(self): params = {} params["m"] = 3 params["n"] = 3 params["pieces"] = [0, 0, 3] self.game = Constraint(params)
def setUp(self): params = {} params["m"] = 7 params["n"] = 7 params["pieces"] = [0, 0, 1, 1, 2, 2, 4] self.game = Constraint(params)