Browse Source

Unittest: changed deception map

remotes/origin/map
Tanja Herche 2 years ago
parent
commit
1d581ea146
  1. 15
      src/main/java/org/bitbiome/commands/MapCommand.java
  2. 16
      src/test/java/org/bitbiome/commands/MapCommandTest.java

15
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();
}

16
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);
}

Loading…
Cancel
Save