|
@ -124,4 +124,24 @@ class VisualizerPlainTextUltraTest { |
|
|
// assert |
|
|
// assert |
|
|
assertThat(result).startsWith("\nSCORE: 100"); |
|
|
assertThat(result).startsWith("\nSCORE: 100"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
void VisualizerPlainTextUtlra_lives_areVisualized() { |
|
|
|
|
|
// arrange |
|
|
|
|
|
|
|
|
|
|
|
GameManager gameManager = new GameManager(); |
|
|
|
|
|
VisualizerPlainTextUltra vptu = new VisualizerPlainTextUltra(gameManager); |
|
|
|
|
|
vptu.showScore = true; |
|
|
|
|
|
|
|
|
|
|
|
gameManager.score = 100; |
|
|
|
|
|
|
|
|
|
|
|
String expected = "\nSCORE: " + gameManager.score + " LIVES: " + gameManager.livesRemaining + "\n\n"; |
|
|
|
|
|
|
|
|
|
|
|
// act |
|
|
|
|
|
vptu.Update(); |
|
|
|
|
|
String result = (String)vptu.GetOutput(); |
|
|
|
|
|
|
|
|
|
|
|
// assert |
|
|
|
|
|
assertThat(result).startsWith(expected); |
|
|
|
|
|
} |
|
|
} |
|
|
} |