Browse Source

added test for visualizer showing score

main
fdai7012 11 months ago
parent
commit
7685080401
  1. 18
      src/test/java/pacmanTests/VisualizerPlainTextUltraTest.java

18
src/test/java/pacmanTests/VisualizerPlainTextUltraTest.java

@ -106,4 +106,22 @@ class VisualizerPlainTextUltraTest {
// assert
assertThat(result).endsWith(expectedEnd);
}
@Test
void VisualizerPlainTextUtlra_score_isVisualized() {
// arrange
GameManager gameManager = new GameManager();
VisualizerPlainTextUltra vptu = new VisualizerPlainTextUltra(gameManager);
vptu.showScore = true;
gameManager.score = 100;
// act
vptu.Update();
String result = (String)vptu.GetOutput();
// assert
assertThat(result).startsWith("\nSCORE: 100");
}
}
Loading…
Cancel
Save