|
@ -10,4 +10,31 @@ import pacmanGame.*; |
|
|
|
|
|
|
|
|
class VisualizerPlainTextUltraTest { |
|
|
class VisualizerPlainTextUltraTest { |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
void VisualizerPlainTextUtlra_mapCells_areVisualized() { |
|
|
|
|
|
// arrange |
|
|
|
|
|
String[] mapTest = { |
|
|
|
|
|
"w.w", |
|
|
|
|
|
"e.e", |
|
|
|
|
|
"w.w" |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
GameManager gameManager = new GameManager(); |
|
|
|
|
|
gameManager.map = new Map(mapTest, gameManager); |
|
|
|
|
|
VisualizerPlainTextUltra vptu = new VisualizerPlainTextUltra(gameManager); |
|
|
|
|
|
vptu.showScore = false; |
|
|
|
|
|
|
|
|
|
|
|
String expected = "" |
|
|
|
|
|
+ "|''| . |''|\n" |
|
|
|
|
|
+ "|__| |__|\n" |
|
|
|
|
|
+ " . \n" |
|
|
|
|
|
+ " \n" |
|
|
|
|
|
+ "|''| . |''|\n" |
|
|
|
|
|
+ "|__| |__|\n"; |
|
|
|
|
|
// act |
|
|
|
|
|
vptu.Update(); |
|
|
|
|
|
String result = (String)vptu.GetOutput(); |
|
|
|
|
|
// assert |
|
|
|
|
|
assertThat(expected).isEqualTo(result); |
|
|
|
|
|
} |
|
|
} |
|
|
} |