Browse Source

Unittest: Changed color description map

remotes/origin/map
Tanja Herche 2 years ago
parent
commit
2dbda7b864
  1. 12
      src/main/java/org/bitbiome/commands/MapCommand.java
  2. 13
      src/test/java/org/bitbiome/commands/MapCommandTest.java

12
src/main/java/org/bitbiome/commands/MapCommand.java

@ -17,7 +17,7 @@ public class MapCommand implements CommandAPI{
JSONArray locations = travelEngine.getLocationList(); JSONArray locations = travelEngine.getLocationList();
if (travelEngine.getPlayer().getLocation().getName().equalsIgnoreCase("Wald")) { if (travelEngine.getPlayer().getLocation().getName().equalsIgnoreCase("Wald")) {
outputMessage outputMessage
.append(Colors.ANSI_BLUE + getLocationMessage(travelEngine) + "\n" + "Zu den blau markierten Standorten kannst du reisen\n" + Colors.ANSI_RESET)
.append(Colors.ANSI_BLUE + getLocationMessage(travelEngine) + "\n" + Colors.ANSI_RESET + "Zu den " + Colors.ANSI_BLUE + "blau " + Colors.ANSI_RESET + "markierten Standorten kannst du reisen\n" + Colors.ANSI_RESET)
.append(Colors.ANSI_BLUE + "Deine Karte:\n\n" + Colors.ANSI_RESET) .append(Colors.ANSI_BLUE + "Deine Karte:\n\n" + Colors.ANSI_RESET)
.append(" __________________________________________________________________________________________________\n") .append(" __________________________________________________________________________________________________\n")
.append("| | | |\n") .append("| | | |\n")
@ -32,7 +32,7 @@ public class MapCommand implements CommandAPI{
.append("|________________________________|________________________________|________________________________|\n"); .append("|________________________________|________________________________|________________________________|\n");
} else if (travelEngine.getPlayer().getLocation().getName().equalsIgnoreCase("Strand")) { } else if (travelEngine.getPlayer().getLocation().getName().equalsIgnoreCase("Strand")) {
outputMessage outputMessage
.append(Colors.ANSI_BLUE + getLocationMessage(travelEngine) + "\n" + "Zu den blau markierten Standorten kannst du reisen\n" + Colors.ANSI_RESET)
.append(Colors.ANSI_BLUE + getLocationMessage(travelEngine) + "\n" + Colors.ANSI_RESET + "Zu den " + Colors.ANSI_BLUE + "blau " + Colors.ANSI_RESET + "markierten Standorten kannst du reisen\n" + Colors.ANSI_RESET)
.append(Colors.ANSI_BLUE + "Deine Karte:\n\n" + Colors.ANSI_RESET) .append(Colors.ANSI_BLUE + "Deine Karte:\n\n" + Colors.ANSI_RESET)
.append(" __________________________________________________________________________________________________\n") .append(" __________________________________________________________________________________________________\n")
.append("| | | |\n") .append("| | | |\n")
@ -48,7 +48,7 @@ public class MapCommand implements CommandAPI{
} else if (travelEngine.getPlayer().getLocation().getName().equalsIgnoreCase("Berge")) { } else if (travelEngine.getPlayer().getLocation().getName().equalsIgnoreCase("Berge")) {
outputMessage outputMessage
.append(Colors.ANSI_BLUE + getLocationMessage(travelEngine) + "\n" + "Zu den blau markierten Standorten kannst du reisen\n" + Colors.ANSI_RESET)
.append(Colors.ANSI_BLUE + getLocationMessage(travelEngine) + "\n" + Colors.ANSI_RESET + "Zu den " + Colors.ANSI_BLUE + "blau " + Colors.ANSI_RESET + "markierten Standorten kannst du reisen\n" + Colors.ANSI_RESET)
.append(Colors.ANSI_BLUE + "Deine Karte:\n\n" + Colors.ANSI_RESET) .append(Colors.ANSI_BLUE + "Deine Karte:\n\n" + Colors.ANSI_RESET)
.append(" __________________________________________________________________________________________________\n") .append(" __________________________________________________________________________________________________\n")
.append("| | | |\n") .append("| | | |\n")
@ -64,7 +64,7 @@ public class MapCommand implements CommandAPI{
} else if (travelEngine.getPlayer().getLocation().getName().equalsIgnoreCase("Wueste")) { } else if (travelEngine.getPlayer().getLocation().getName().equalsIgnoreCase("Wueste")) {
outputMessage outputMessage
.append(Colors.ANSI_BLUE + getLocationMessage(travelEngine) + "\n" + "Zu den blau markierten Standorten kannst du reisen\n" + Colors.ANSI_RESET)
.append(Colors.ANSI_BLUE + getLocationMessage(travelEngine) + "\n" + Colors.ANSI_RESET + "Zu den " + Colors.ANSI_BLUE + "blau " + Colors.ANSI_RESET + "markierten Standorten kannst du reisen\n" + Colors.ANSI_RESET)
.append(Colors.ANSI_BLUE + "Deine Karte:\n\n" + Colors.ANSI_RESET) .append(Colors.ANSI_BLUE + "Deine Karte:\n\n" + Colors.ANSI_RESET)
.append(" __________________________________________________________________________________________________\n") .append(" __________________________________________________________________________________________________\n")
.append("| | | |\n") .append("| | | |\n")
@ -80,7 +80,7 @@ public class MapCommand implements CommandAPI{
} else if (travelEngine.getPlayer().getLocation().getName().equalsIgnoreCase("Gruenland")) { } else if (travelEngine.getPlayer().getLocation().getName().equalsIgnoreCase("Gruenland")) {
outputMessage outputMessage
.append(Colors.ANSI_BLUE + getLocationMessage(travelEngine) + "\n" + "Zu den blau markierten Standorten kannst du reisen\n" + Colors.ANSI_RESET)
.append(Colors.ANSI_BLUE + getLocationMessage(travelEngine) + "\n" + Colors.ANSI_RESET + "Zu den " + Colors.ANSI_BLUE + "blau " + Colors.ANSI_RESET + "markierten Standorten kannst du reisen\n" + Colors.ANSI_RESET)
.append(Colors.ANSI_BLUE + "Deine Karte:\n\n" + Colors.ANSI_RESET) .append(Colors.ANSI_BLUE + "Deine Karte:\n\n" + Colors.ANSI_RESET)
.append(" __________________________________________________________________________________________________\n") .append(" __________________________________________________________________________________________________\n")
.append("| | | |\n") .append("| | | |\n")
@ -96,7 +96,7 @@ public class MapCommand implements CommandAPI{
} else { } else {
outputMessage outputMessage
.append(Colors.ANSI_BLUE + getLocationMessage(travelEngine) + "\n" + Colors.ANSI_RESET)
.append(Colors.ANSI_BLUE + getLocationMessage(travelEngine) + "\n" + Colors.ANSI_RESET + "Zu den " + Colors.ANSI_BLUE + "blau " + Colors.ANSI_RESET + "markierten Standorten kannst du reisen\n" + Colors.ANSI_RESET)
.append(Colors.ANSI_BLUE + "Deine Karte:\n\n" + Colors.ANSI_RESET) .append(Colors.ANSI_BLUE + "Deine Karte:\n\n" + Colors.ANSI_RESET)
.append(" __________________________________________________________________________________________________\n") .append(" __________________________________________________________________________________________________\n")
.append("| | | |\n") .append("| | | |\n")

13
src/test/java/org/bitbiome/commands/MapCommandTest.java

@ -21,7 +21,7 @@ public class MapCommandTest {
String mapMessage = MapCommand.getMapMessage(outputtest); String mapMessage = MapCommand.getMapMessage(outputtest);
StringBuilder outputMessage = new StringBuilder(); StringBuilder outputMessage = new StringBuilder();
outputMessage outputMessage
.append(Colors.ANSI_BLUE + "Du befindest dich gerade hier: Wald" + "\n" + "Zu den blau markierten Standorten kannst du reisen\n" + Colors.ANSI_RESET)
.append(Colors.ANSI_BLUE + "Du befindest dich gerade hier: Wald" + "\n" + Colors.ANSI_RESET + "Zu den " + Colors.ANSI_BLUE + "blau " + Colors.ANSI_RESET + "markierten Standorten kannst du reisen\n" + Colors.ANSI_RESET)
.append(Colors.ANSI_BLUE + "Deine Karte:\n\n" + Colors.ANSI_RESET) .append(Colors.ANSI_BLUE + "Deine Karte:\n\n" + Colors.ANSI_RESET)
.append(" __________________________________________________________________________________________________\n") .append(" __________________________________________________________________________________________________\n")
.append("| | | |\n") .append("| | | |\n")
@ -47,7 +47,7 @@ public class MapCommandTest {
String mapMessage = MapCommand.getMapMessage(outputtest); String mapMessage = MapCommand.getMapMessage(outputtest);
StringBuilder outputMessage = new StringBuilder(); StringBuilder outputMessage = new StringBuilder();
outputMessage outputMessage
.append(Colors.ANSI_BLUE + "Du befindest dich gerade hier: Strand" + "\n" + "Zu den blau markierten Standorten kannst du reisen\n" + Colors.ANSI_RESET)
.append(Colors.ANSI_BLUE + "Du befindest dich gerade hier: Strand" + "\n" + Colors.ANSI_RESET + "Zu den " + Colors.ANSI_BLUE + "blau " + Colors.ANSI_RESET + "markierten Standorten kannst du reisen\n" + Colors.ANSI_RESET)
.append(Colors.ANSI_BLUE + "Deine Karte:\n\n" + Colors.ANSI_RESET) .append(Colors.ANSI_BLUE + "Deine Karte:\n\n" + Colors.ANSI_RESET)
.append(" __________________________________________________________________________________________________\n") .append(" __________________________________________________________________________________________________\n")
.append("| | | |\n") .append("| | | |\n")
@ -73,7 +73,7 @@ public class MapCommandTest {
String mapMessage = MapCommand.getMapMessage(outputtest); String mapMessage = MapCommand.getMapMessage(outputtest);
StringBuilder outputMessage = new StringBuilder(); StringBuilder outputMessage = new StringBuilder();
outputMessage outputMessage
.append(Colors.ANSI_BLUE + "Du befindest dich gerade hier: Berge" + "\n" + "Zu den blau markierten Standorten kannst du reisen\n" + Colors.ANSI_RESET)
.append(Colors.ANSI_BLUE + "Du befindest dich gerade hier: Berge" + "\n" + Colors.ANSI_RESET + "Zu den " + Colors.ANSI_BLUE + "blau " + Colors.ANSI_RESET + "markierten Standorten kannst du reisen\n" + Colors.ANSI_RESET)
.append(Colors.ANSI_BLUE + "Deine Karte:\n\n" + Colors.ANSI_RESET) .append(Colors.ANSI_BLUE + "Deine Karte:\n\n" + Colors.ANSI_RESET)
.append(" __________________________________________________________________________________________________\n") .append(" __________________________________________________________________________________________________\n")
.append("| | | |\n") .append("| | | |\n")
@ -99,7 +99,7 @@ public class MapCommandTest {
String mapMessage = MapCommand.getMapMessage(outputtest); String mapMessage = MapCommand.getMapMessage(outputtest);
StringBuilder outputMessage = new StringBuilder(); StringBuilder outputMessage = new StringBuilder();
outputMessage outputMessage
.append(Colors.ANSI_BLUE + "Du befindest dich gerade hier: Wueste" + "\n" + "Zu den blau markierten Standorten kannst du reisen\n" + Colors.ANSI_RESET)
.append(Colors.ANSI_BLUE + "Du befindest dich gerade hier: Wueste" + "\n" + Colors.ANSI_RESET + "Zu den " + Colors.ANSI_BLUE + "blau " + Colors.ANSI_RESET + "markierten Standorten kannst du reisen\n" + Colors.ANSI_RESET)
.append(Colors.ANSI_BLUE + "Deine Karte:\n\n" + Colors.ANSI_RESET) .append(Colors.ANSI_BLUE + "Deine Karte:\n\n" + Colors.ANSI_RESET)
.append(" __________________________________________________________________________________________________\n") .append(" __________________________________________________________________________________________________\n")
.append("| | | |\n") .append("| | | |\n")
@ -116,6 +116,7 @@ public class MapCommandTest {
assertEquals(outputMessage.toString(), mapMessage); assertEquals(outputMessage.toString(), mapMessage);
} }
@Test
public void testGruenlandMapCommand() { public void testGruenlandMapCommand() {
Player Test = new Player("name"); Player Test = new Player("name");
TravelEngine outputtest = new TravelEngine(Test); TravelEngine outputtest = new TravelEngine(Test);
@ -124,7 +125,7 @@ public class MapCommandTest {
String mapMessage = MapCommand.getMapMessage(outputtest); String mapMessage = MapCommand.getMapMessage(outputtest);
StringBuilder outputMessage = new StringBuilder(); StringBuilder outputMessage = new StringBuilder();
outputMessage outputMessage
.append(Colors.ANSI_BLUE + "Du befindest dich gerade hier: Gruenland" + "\n" + "Zu den blau markierten Standorten kannst du reisen\n" + Colors.ANSI_RESET)
.append(Colors.ANSI_BLUE + "Du befindest dich gerade hier: Gruenland" + "\n" + Colors.ANSI_RESET + "Zu den " + Colors.ANSI_BLUE + "blau " + Colors.ANSI_RESET + "markierten Standorten kannst du reisen\n" + Colors.ANSI_RESET)
.append(Colors.ANSI_BLUE + "Deine Karte:\n\n" + Colors.ANSI_RESET) .append(Colors.ANSI_BLUE + "Deine Karte:\n\n" + Colors.ANSI_RESET)
.append(" __________________________________________________________________________________________________\n") .append(" __________________________________________________________________________________________________\n")
.append("| | | |\n") .append("| | | |\n")
@ -150,7 +151,7 @@ public class MapCommandTest {
String mapMessage = MapCommand.getMapMessage(outputtest); String mapMessage = MapCommand.getMapMessage(outputtest);
StringBuilder outputMessage = new StringBuilder(); StringBuilder outputMessage = new StringBuilder();
outputMessage outputMessage
.append(Colors.ANSI_BLUE + "Du befindest dich gerade hier: Winterland" + "\n" + Colors.ANSI_RESET)
.append(Colors.ANSI_BLUE + "Du befindest dich gerade hier: Winterland" + "\n" + Colors.ANSI_RESET + "Zu den " + Colors.ANSI_BLUE + "blau " + Colors.ANSI_RESET + "markierten Standorten kannst du reisen\n" + Colors.ANSI_RESET)
.append(Colors.ANSI_BLUE + "Deine Karte:\n\n" + Colors.ANSI_RESET) .append(Colors.ANSI_BLUE + "Deine Karte:\n\n" + Colors.ANSI_RESET)
.append(" __________________________________________________________________________________________________\n") .append(" __________________________________________________________________________________________________\n")
.append("| | | |\n") .append("| | | |\n")

Loading…
Cancel
Save