コード例 #1
0
ファイル: test_game.py プロジェクト: TakaGoto/tictactaka
class TestGameUi(unittest.TestCase):

  def setUp(self):
    self.ui = UiMock()
    self.game = Game(self.ui, SETTINGS)

  def testGamePromptsWelcome(self):
    self.game.start_game()

    self.assertEqual(True, self.game.ui.prompted_welcome)

  def testGamePromptsGoodBye(self):
    self.game.end_game()

    self.assertEqual(True, self.game.ui.prompted_good_bye)

  def testGamePromptsForMove(self):
    self.game.make_move()

    self.assertEqual(True, self.game.ui.prompted_user_for_move)

  def testGamePrintsBoard(self):
    self.game.make_move()

    self.assertEqual(True, self.game.ui.prompted_board)