|
@ -74,13 +74,22 @@ class GameManagerTest { |
|
|
game.handleGhostCollision(); |
|
|
game.handleGhostCollision(); |
|
|
game.handleGhostCollision(); |
|
|
game.handleGhostCollision(); |
|
|
int expectedScore = 0; |
|
|
int expectedScore = 0; |
|
|
|
|
|
|
|
|
assertThat(game.score).isEqualTo(expectedScore); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assertThat(game.score).isEqualTo(expectedScore); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
void testPlayerLivesRestoredwhenGhostCaughtPlayerTreeTime() { |
|
|
|
|
|
GameManager game = new GameManager(); |
|
|
|
|
|
|
|
|
|
|
|
game.livesRemaining = 3; |
|
|
|
|
|
game.handleGhostCollision(); |
|
|
|
|
|
game.handleGhostCollision(); |
|
|
|
|
|
game.handleGhostCollision(); |
|
|
|
|
|
int expectedLives = 3; |
|
|
|
|
|
assertThat(game.livesRemaining).isEqualTo(expectedLives); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
void GameManager_GostPlayerCollisionTest_DoesntDetectColliosion() { |
|
|
void GameManager_GostPlayerCollisionTest_DoesntDetectColliosion() { |
|
|
// arrange |
|
|
// arrange |
|
|