def test_checkFinish_LeftToRightDiagonalIsAllFirstPlayer_ReturnsFirstPlayerWon(self): game = Game() game.addFirstPlayerMove("A3") game.addFirstPlayerMove("B2") game.addFirstPlayerMove("C1") result = game.checkFinish() self.assertEqual(result, game.FirstPlayerWin, 'The first player should have won')
def test_checkFinish_ThirdColumnIsAllFirstPlayer_ReturnsFirstPlayerWon(self): game = Game() game.addFirstPlayerMove("A3") game.addFirstPlayerMove("B3") game.addFirstPlayerMove("C3") result = game.checkFinish() self.assertEqual(result, game.FirstPlayerWin, 'The first player should have won')
def test_checkFinish_ThirdRowIsAllFirstPlayer_ReturnsFirstPlayerWon(self): game = Game() game.addFirstPlayerMove("C1") game.addFirstPlayerMove("C2") game.addFirstPlayerMove("C3") result = game.checkFinish() self.assertEqual(result, game.FirstPlayerWin, 'The first player should have won')
def test_checkFinish_LeftToRightDiagonalIsAllFirstPlayer_ReturnsFirstPlayerWon( self): game = Game() game.addFirstPlayerMove("A3") game.addFirstPlayerMove("B2") game.addFirstPlayerMove("C1") result = game.checkFinish() self.assertEqual(result, game.FirstPlayerWin, 'The first player should have won')
def test_noMovesLeft_FullField_ReturnsTrue(self): game = Game() game.addFirstPlayerMove("A1") game.addFirstPlayerMove("A2") game.addFirstPlayerMove("A3") game.addFirstPlayerMove("B1") game.addFirstPlayerMove("B2") game.addFirstPlayerMove("B3") game.addFirstPlayerMove("C1") game.addFirstPlayerMove("C2") game.addFirstPlayerMove("C3") result = game.noMovesLeft() self.assertTrue(result)
def test_noMovesLeft_FullField_ReturnsTrue(self): game = Game() game.addFirstPlayerMove("A1") game.addFirstPlayerMove("A2") game.addFirstPlayerMove("A3") game.addFirstPlayerMove("B1") game.addFirstPlayerMove("B2") game.addFirstPlayerMove("B3") game.addFirstPlayerMove("C1") game.addFirstPlayerMove("C2") game.addFirstPlayerMove("C3") result = game.noMovesLeft() self.assertTrue(result)
def test_addFirstPlayerMove_AddLegalMove_MoveHasBeenAddedToBoard(self): game = Game() game.addFirstPlayerMove("A1") self.assertTrue(game.checkSquareIsPlayer(game.FirstPlayer,"A1"))
def test_checkSquareIsOccupied_ItIs_ReturnsTrue(self): game = Game() game.addFirstPlayerMove("A1") result = game.checkSquareIsOccupied("A1") self.assertTrue(result)
def test_addFirstPlayerMove_IllegalMove_MoveHasBeenAddedToBoard(self): game = Game() game.addFirstPlayerMove("A1") result = game.addFirstPlayerMove("A1") self.assertEqual(result,'Square already occupied', 'Should have said the square was occupied')
def test_addFirstPlayerMove_AddLegalMove_MoveHasBeenAddedToBoard(self): game = Game() game.addFirstPlayerMove("A1") self.assertTrue(game.checkSquareIsPlayer(game.FirstPlayer, "A1"))
def test_checkSquareIsOccupied_ItIs_ReturnsTrue(self): game = Game() game.addFirstPlayerMove("A1") result = game.checkSquareIsOccupied("A1") self.assertTrue(result)
def test_addFirstPlayerMove_IllegalMove_MoveHasBeenAddedToBoard(self): game = Game() game.addFirstPlayerMove("A1") result = game.addFirstPlayerMove("A1") self.assertEqual(result, 'Square already occupied', 'Should have said the square was occupied')