コード例 #1
0
    def test_get_game(self):
        '''
        Tests the game currently being played can be retrieved.
        '''
        gc = GameController(300)
        gc.set_up_game()

        assert isinstance(gc.get_game(), Game)
コード例 #2
0
    def test_get_game(self):
        """
        This method tests the ability of the GameController to retrieve the game it is currently playing. The expected
        result of this test is for the GameController's game to be correctly retrieved.
        """
        gc = GameController()
        gc.set_up_game()

        # Assert that the game has been retrieved.
        assert gc.get_game()
コード例 #3
0
    def test_play_next_turn(self):
        '''
        Tests a single turn of the game can be played.
        '''
        gc = GameController(300)
        gc.set_up_game()

        gc.play_next_turn()

        assert gc.get_game().get_turn_count() == 1
コード例 #4
0
    def test_play_next_turn(self):
        """
        This method tests the ability of the GameController to play a single turn of its current game. The expected
        result of this test is for the GameController to correclty play one turn of its current game.
        """
        gc = GameController()
        gc.set_up_game()

        gc.play_next_turn()

        # If the next turn has been played, the turn count should now be 1. Assert this is true.
        assert gc.get_game().get_turn_count() == 1