Exemple #1
0
 def test_make_invalid_move1(self):
     game = Game(self.player1, self.player2)
     gb = game.game_board
     game.current_player = self.player1
     gb.update_board(game.who_is_moving(), 2)
     game.toggle_player()
     gb.update_board(game.who_is_moving(), 2)
     self.assertFalse(gb.is_space_free(2))
Exemple #2
0
 def test_make_valid_move1(self):
     game = Game(self.player1, self.player2)
     gb = game.game_board
     game.who_plays_first()
     gb.update_board(game.who_is_moving(), 1)
     self.assertFalse(gb.is_space_free(1))
     self.assertTrue(gb.is_space_free(3))
Exemple #3
0
 def test_make_valid_move2(self):
     game = Game(self.player1, self.player2)
     gb = game.game_board
     game.who_plays_first()
     gb.update_board(game.who_is_moving(), 1)
     game.toggle_player()
     gb.update_board(game.who_is_moving(), 2)
     game.toggle_player()
     gb.update_board(game.who_is_moving(), 3)
     game.toggle_player()
     gb.update_board(game.who_is_moving(), 4)
     game.toggle_player()
     gb.update_board(game.who_is_moving(), 5)
     game.toggle_player()
     gb.update_board(game.who_is_moving(), 6)
     game.toggle_player()
     gb.update_board(game.who_is_moving(), 7)
     game.toggle_player()
     gb.update_board(game.who_is_moving(), 8)
     game.toggle_player()
     self.assertFalse(gb.is_board_full())
     gb.update_board(game.who_is_moving(), 9)
     game.toggle_player()
     self.assertTrue(gb.is_board_full())
Exemple #4
0
 def test_who_is_playing(self):
     game = Game(self.player1, self.player2)
     game.current_player = self.player1
     self.assertEqual(game.who_is_moving(), self.player1)