From a5178c56a3b92e651202df684424dbd1db59a798 Mon Sep 17 00:00:00 2001 From: fdai7012 Date: Thu, 8 Feb 2024 02:07:48 +0100 Subject: [PATCH] added another test for vput --- .../VisualizerPlainTextUltraTest.java | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/test/java/pacmanTests/VisualizerPlainTextUltraTest.java b/src/test/java/pacmanTests/VisualizerPlainTextUltraTest.java index d42b9f3..e7e42e9 100644 --- a/src/test/java/pacmanTests/VisualizerPlainTextUltraTest.java +++ b/src/test/java/pacmanTests/VisualizerPlainTextUltraTest.java @@ -37,4 +37,34 @@ class VisualizerPlainTextUltraTest { // assert assertThat(expected).isEqualTo(result); } + + @Test + void VisualizerPlainTextUltra_ghosts_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; + + gameManager.ghosts[0].position = new Vector2(1, 1); + + String expected = "" + + "|''| . |''|\n" + + "|__| |__|\n" + + " /--\\ \n" + + " ~~~~ \n" + + "|''| . |''|\n" + + "|__| |__|\n"; + // act + vptu.Update(); + String result = (String)vptu.GetOutput(); + // assert + assertThat(expected).isEqualTo(result); + } }