コード例 #1
0
ファイル: CheckersGameStateTests.py プロジェクト: AJayce/ai4u
 def test_initialStateGetCurrentPlayer_returnsBlackPlayer(self):
     # Arrange
     state = CheckersGameState()
     # Act
     player = state.getCurrentPlayer()
     # Assert
     self.assertEqual(CheckersPlayer.BLACK, player.getColor(), "The black player plays first")
コード例 #2
0
ファイル: CheckersGameStateTests.py プロジェクト: AJayce/ai4u
 def test_initialStateGetActions_returnsGameIsNotOver(self):
     # Arrange
     state = CheckersGameState()
     # Act
     isGameOver = state.isGameOver()
     # Assert
     self.assertFalse(isGameOver, "At its initial state, the game should not be over")
コード例 #3
0
ファイル: CheckersGameStateTests.py プロジェクト: AJayce/ai4u
 def test_initialStateGetActions_returns7Actions(self):
     # Arrange
     state = CheckersGameState()
     # Act
     actions = state.getActions()
     # Assert
     self.assertEqual(7, len(actions), "The initial state should have exactly 7 states")
コード例 #4
0
 def test_initialStateGetCurrentPlayer_returnsBlackPlayer(self):
     # Arrange
     state = CheckersGameState()
     # Act
     player = state.getCurrentPlayer()
     # Assert
     self.assertEqual(CheckersPlayer.BLACK, player.getColor(),
                      "The black player plays first")
コード例 #5
0
 def test_initialStateGetActions_returnsGameIsNotOver(self):
     # Arrange
     state = CheckersGameState()
     # Act
     isGameOver = state.isGameOver()
     # Assert
     self.assertFalse(isGameOver,
                      "At its initial state, the game should not be over")
コード例 #6
0
 def test_initialStateGetActions_returns7Actions(self):
     # Arrange
     state = CheckersGameState()
     # Act
     actions = state.getActions()
     # Assert
     self.assertEqual(7, len(actions),
                      "The initial state should have exactly 7 states")