Browse Source

Refactoring: TestplayerlivesRestore with for loop

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

4
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;
for(int i = 0;i < 3; i++) {
game.handleGhostCollision(); game.handleGhostCollision();
game.handleGhostCollision();
game.handleGhostCollision();
}
int expectedLives = 3; int expectedLives = 3;
assertThat(game.livesRemaining).isEqualTo(expectedLives); assertThat(game.livesRemaining).isEqualTo(expectedLives);
} }

Loading…
Cancel
Save