Пример #1
0
 def test_when_valid_parameters_and_valid_game_and_none_user_sudoku_then_should_an_exception_be_raised(self):
     cmd = StartCommand(None)
     game = Game()
     cmd.set_game(game)
     
     try:
         cmd.execute()
         self.fail("Expected InvalidCmdParametersException was not raised.")
     except InvalidCmdParametersException:
         pass
Пример #2
0
    def test_when_valid_parameters_and_valid_game_and_a_valid_user_sudoku_then_should_the_game_be_started(self):
        user_sudoku = SudokuBoard(3)

        game = Game()
        game.started = False
        game.user_sudoku = user_sudoku
        
        cmd = StartCommand(None)
        cmd.set_game(game)
        cmd.execute()
        self.assertTrue(game.started)