From c1ea9edb72b692690c79288c92c587cc4eaca86c Mon Sep 17 00:00:00 2001 From: fdai7012 Date: Thu, 8 Feb 2024 02:07:12 +0100 Subject: [PATCH] Added test for vptu --- .../VisualizerPlainTextUltraTest.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/test/java/pacmanTests/VisualizerPlainTextUltraTest.java b/src/test/java/pacmanTests/VisualizerPlainTextUltraTest.java index 97d52de..d42b9f3 100644 --- a/src/test/java/pacmanTests/VisualizerPlainTextUltraTest.java +++ b/src/test/java/pacmanTests/VisualizerPlainTextUltraTest.java @@ -10,4 +10,31 @@ import pacmanGame.*; 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); + } }