From 5671fddb70031ab370f59ed1003b89d843a37052 Mon Sep 17 00:00:00 2001 From: fdai7012 Date: Thu, 8 Feb 2024 14:57:45 +0100 Subject: [PATCH] added test for pause visualization --- .../VisualizerPlainTextUltraTest.java | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/src/test/java/pacmanTests/VisualizerPlainTextUltraTest.java b/src/test/java/pacmanTests/VisualizerPlainTextUltraTest.java index e7e42e9..d0229f4 100644 --- a/src/test/java/pacmanTests/VisualizerPlainTextUltraTest.java +++ b/src/test/java/pacmanTests/VisualizerPlainTextUltraTest.java @@ -67,4 +67,43 @@ class VisualizerPlainTextUltraTest { // assert 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"); + } }