From 1d581ea146ca3b7c614f35a358486f5a70739ebf Mon Sep 17 00:00:00 2001 From: Tanja Herche Date: Fri, 3 Feb 2023 23:27:23 +0100 Subject: [PATCH] Unittest: changed deception map --- .../java/org/bitbiome/commands/MapCommand.java | 15 ++++++++++++--- .../org/bitbiome/commands/MapCommandTest.java | 16 +++++++++++++--- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/bitbiome/commands/MapCommand.java b/src/main/java/org/bitbiome/commands/MapCommand.java index 9c77559..633a77d 100644 --- a/src/main/java/org/bitbiome/commands/MapCommand.java +++ b/src/main/java/org/bitbiome/commands/MapCommand.java @@ -17,9 +17,18 @@ public class MapCommand implements CommandAPI{ JSONArray locations = travelEngine.getLocationList(); outputMessage .append(Colors.ANSI_BLUE + getLocationMessage(travelEngine) + "\n" + Colors.ANSI_RESET) - .append(Colors.ANSI_BLUE + "Deine Karte:\n" + Colors.ANSI_RESET) - .append(Colors.ANSI_BLUE + locations.getJSONObject(5).getString("name") + " " + locations.getJSONObject(4).getString("name") + " " + locations.getJSONObject(2).getString("name") + "\n\n" + Colors.ANSI_RESET) - .append(Colors.ANSI_BLUE + locations.getJSONObject(1).getString("name") + " " + locations.getJSONObject(0).getString("name") + " " + locations.getJSONObject(3).getString("name") + "\n\n" + Colors.ANSI_RESET); + .append(Colors.ANSI_BLUE + "Deine Karte:\n\n" + Colors.ANSI_RESET) + .append(" __________________________________________________________________________________________________\n") + .append("| | | |\n") + .append("| | | |\n") + .append("| " + Colors.ANSI_BLUE + locations.getJSONObject(5).getString("name") + Colors.ANSI_RESET + " | " + Colors.ANSI_BLUE + locations.getJSONObject(4).getString("name") + Colors.ANSI_RESET + " | " + Colors.ANSI_BLUE + locations.getJSONObject(2).getString("name") + Colors.ANSI_RESET + " |" + "\n") + .append("| | | |\n") + .append("|________________________________|________________________________|________________________________|\n") + .append("| | | |\n") + .append("| | | |\n") + .append("| " + Colors.ANSI_BLUE + locations.getJSONObject(1).getString("name") + Colors.ANSI_RESET + " | " + Colors.ANSI_BLUE + locations.getJSONObject(0).getString("name") + Colors.ANSI_RESET + " | " + Colors.ANSI_BLUE + locations.getJSONObject(3).getString("name") + Colors.ANSI_RESET + " |" + "\n") + .append("| | | |\n") + .append("|________________________________|________________________________|________________________________|\n"); return outputMessage.toString(); } diff --git a/src/test/java/org/bitbiome/commands/MapCommandTest.java b/src/test/java/org/bitbiome/commands/MapCommandTest.java index 2f28573..515d572 100644 --- a/src/test/java/org/bitbiome/commands/MapCommandTest.java +++ b/src/test/java/org/bitbiome/commands/MapCommandTest.java @@ -16,9 +16,19 @@ public class MapCommandTest { StringBuilder outputMessage = new StringBuilder(); outputMessage .append(Colors.ANSI_BLUE + "Du befindest dich gerade hier: Wald" + "\n" + Colors.ANSI_RESET) - .append(Colors.ANSI_BLUE + "Deine Karte:\n" + Colors.ANSI_RESET) - .append(Colors.ANSI_BLUE + "Wueste Gruenland Winterland\n\n" + Colors.ANSI_RESET) - .append(Colors.ANSI_BLUE + "Strand Wald Berge\n\n" + Colors.ANSI_RESET); + .append(Colors.ANSI_BLUE + "Deine Karte:\n\n" + Colors.ANSI_RESET) + .append(" __________________________________________________________________________________________________\n") + .append("| | | |\n") + .append("| | | |\n") + .append("| " + Colors.ANSI_BLUE + "Wueste" + Colors.ANSI_RESET + " | " + Colors.ANSI_BLUE + "Gruenland" + Colors.ANSI_RESET + " | " + Colors.ANSI_BLUE + "Winterland" + Colors.ANSI_RESET + " |" + "\n") + .append("| | | |\n") + .append("|________________________________|________________________________|________________________________|\n") + .append("| | | |\n") + .append("| | | |\n") + .append("| " + Colors.ANSI_BLUE + "Strand" + Colors.ANSI_RESET + " | " + Colors.ANSI_BLUE + "Wald" + Colors.ANSI_RESET + " | " + Colors.ANSI_BLUE + "Berge" + Colors.ANSI_RESET + " |" + "\n") + .append("| | | |\n") + .append("|________________________________|________________________________|________________________________|\n"); + assertEquals(outputMessage.toString(), mapMessage); }