Browse Source

Test: JunitTest for PlayerLivesRestore after Tree time caught from Ghosts

main
fdai2751 11 months ago
parent
commit
ebf43b21b4
  1. 19
      src/test/java/pacmanTests/GameManagerTest.java

19
src/test/java/pacmanTests/GameManagerTest.java

@ -74,13 +74,22 @@ class GameManagerTest {
game.handleGhostCollision();
game.handleGhostCollision();
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
void GameManager_GostPlayerCollisionTest_DoesntDetectColliosion() {
// arrange

Loading…
Cancel
Save