Browse Source

Refactoring: TestplayerlivesRestore with for loop

main
fdai2751 11 months ago
parent
commit
8222ed42b3
  1. 6
      src/test/java/pacmanTests/GameManagerTest.java

6
src/test/java/pacmanTests/GameManagerTest.java

@ -83,9 +83,9 @@ class GameManagerTest {
GameManager game = new GameManager(); GameManager game = new GameManager();
game.livesRemaining = 3; game.livesRemaining = 3;
game.handleGhostCollision();
game.handleGhostCollision();
game.handleGhostCollision();
for(int i = 0;i < 3; i++) {
game.handleGhostCollision();
}
int expectedLives = 3; int expectedLives = 3;
assertThat(game.livesRemaining).isEqualTo(expectedLives); assertThat(game.livesRemaining).isEqualTo(expectedLives);
} }

Loading…
Cancel
Save