Browse Source

added test for pause visualization

main
fdai7012 11 months ago
parent
commit
5671fddb70
  1. 39
      src/test/java/pacmanTests/VisualizerPlainTextUltraTest.java

39
src/test/java/pacmanTests/VisualizerPlainTextUltraTest.java

@ -67,4 +67,43 @@ class VisualizerPlainTextUltraTest {
// assert // assert
assertThat(expected).isEqualTo(result); assertThat(expected).isEqualTo(result);
} }
@Test
void VisualizerPlainTextUtlra_pause_isVisualized() {
// arrange
String[] mapTest = {
"w.w",
"e.e",
"w.w",
"w.w",
"w.w",
"w.w",
"w.w",
"w.w",
"w.w",
"w.w",
"w.w",
"w.w",
"w.w",
"w.w",
"w.w",
"w.w"
};
GameManager gameManager = new GameManager();
gameManager.map = new Map(mapTest, gameManager);
VisualizerPlainTextUltra vptu = new VisualizerPlainTextUltra(gameManager);
vptu.showScore = false;
gameManager.Pause();
// act
vptu.Update();;
String result = (String)vptu.GetOutput();
System.out.println(result + "+");
// assert
assertThat(result).endsWith(" Paused! \n\n");
}
} }
Loading…
Cancel
Save