Ejemplo n.º 1
0
 def test_incomplete_game(self):
     test_game = CheckersGame(
         CheckerBoardFactory.build_board_from_preset(
             CheckerBoardTestPresets.simple_tie_test_board))
     test_game.board.set_up_pieces([], [(5, 5)])
     test_game.switch_team_turn()
     self.assertEqual(test_game.end_game().value, 'incomplete game')
Ejemplo n.º 2
0
 def test_black_wins_game(self):
     move_iterator = create_move_iterator_from_move_file('games/black.txt')
     test_game = CheckersGame(
         CheckerBoardFactory.build_board_from_preset(
             CheckerBoardPresets.standard_8_by_8))
     for ind, move in enumerate(move_iterator):
         test_game.make_move(move)
     self.assertEqual(test_game.end_game().value, 'second')
Ejemplo n.º 3
0
 def test_white_wins_game(self):
     move_iterator = create_move_iterator_from_move_file('games/white.txt')
     test_game = CheckersGame(
         CheckerBoardFactory.build_board_from_preset(
             CheckerBoardPresets.standard_8_by_8))
     for move in move_iterator:
         test_game.make_move(move)
     self.assertEqual(test_game.end_game().value, 'first')
Ejemplo n.º 4
0
 def test_black_wins(self):
     test_game = CheckersGame(
         CheckerBoardFactory.build_board_from_preset(
             CheckerBoardTestPresets.simple_tie_test_board))
     test_game.board.set_up_pieces([], [(7, 7)])
     self.assertEqual(test_game.end_game().value, 'second')
Ejemplo n.º 5
0
 def test_tie(self):
     test_game = CheckersGame(
         CheckerBoardFactory.build_board_from_preset(
             CheckerBoardTestPresets.simple_tie_test_board))
     self.assertEqual(test_game.end_game().value, 'tie game')