Пример #1
0
 def test_if_level_is_moderate_then_a_moderate_level_sudoku_puzzle_should_be_generated(self):
     settings_manager = SettingsManager("mySettings.xml")
     settings_manager.load()
     game = Game()
     game.set_settings_manager(settings_manager)
     game.start_game_timer()
     cmd = GenerateGameCommand(None)
     cmd.set_game(game)
     cmd.execute()
     self.assertIsNotNone(game.initial_sudoku)
Пример #2
0
 def test_if_level_name_is_easy_then_an_easy_level_sudoku_puzzle_should_be_generated(self):
     valid_params = {"level": "EASY"}
     settings_manager = SettingsManager("mySettings.xml")
     settings_manager.load()
     game = Game()
     game.set_settings_manager(settings_manager)
     cmd = GenerateGameCommand(valid_params)
     cmd.set_game(game)
     cmd.execute()
     self.assertIsNotNone(game.initial_sudoku)
Пример #3
0
 def test_an_InvalidCmdParametersException_should_be_raised_if_parameter_has_int_value(self):
     with self.assertRaises(InvalidCmdParametersException):
         game = Game()
         cmd = GenerateGameCommand(self.int_param)
         cmd.set_game(game)
         cmd.execute()
Пример #4
0
 def test_an_InvalidCmdParametersException_should_be_raised_if_game_is_None(self):
     with self.assertRaises(InvalidCmdParametersException):
         cmd = GenerateGameCommand(self.valid_params)
         cmd.execute()