def makeMove(self, xCoordinate, yCoordinate): """ Makes a move for the player :param xCoordinate: The x coordinate of the move :param yCoordinate: The y coordinate of the move """ move = Move(self.sign, xCoordinate, yCoordinate) Validator.validateMove( move, self.__moveRepository.lastMove.sign if self.__moveRepository.lastMove is not None else "") self.__moveRepository.addMove(move)
def test_validateMove(self): Validator.validateMove(self.move1, "O") with self.assertRaises(MoveInvalid): Validator.validateMove(self.move2, "X")