Ejemplo n.º 1
0
    def test_get_time_remaining(self):
        '''
        Tests the remaining time on the controller can be retrieved.
        '''
        gc = GameController(300)

        assert gc.get_time_remaining() == 300
Ejemplo n.º 2
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)
Ejemplo n.º 3
0
    def test_set_up_game(self):
        '''
        Tests whether the game to be played can be correctly set up.
        '''
        gc = GameController(300)
        gc.set_up_game()

        assert isinstance(gc._game, Game)
Ejemplo n.º 4
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()
Ejemplo n.º 5
0
    def test_set_up_game(self):
        """
        This method tests whether the GameController can correctly set up the game it is meant to be playing. The
        expected result of this test is for the GameController's game to be set up correctly.
        """
        gc = GameController()
        gc.set_up_game()

        # Assert that the GameController's game has been initialised, and that it has been initialised as the right
        # type of game.
        assert isinstance(gc._game, Game)
Ejemplo n.º 6
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
Ejemplo n.º 7
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