Browse Source

Unittest: Changed Color Map-Message

remotes/origin/map
Tanja Herche 2 years ago
parent
commit
3862df9f7c
  1. 26
      src/main/java/org/bitbiome/commands/MapCommand.java
  2. 24
      src/test/java/org/bitbiome/commands/MapCommandTest.java

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

@ -10,7 +10,7 @@ public class MapCommand implements CommandAPI{
System.out.println(getMapMessage(travelEngine));
}
public static String getLocationMessage(TravelEngine travelEngine) {
return "Du befindest dich gerade hier: " + travelEngine.getPlayer().getLocation().getName();
return "Du befindest dich gerade hier: " + Colors.ANSI_GREEN + travelEngine.getPlayer().getLocation().getName();
}
public static String getMapMessage(TravelEngine travelEngine) {
StringBuilder outputMessage = new StringBuilder();
@ -23,8 +23,8 @@ public class MapCommand implements CommandAPI{
String locationBerge = locations.getJSONObject(3).getString("name");
if (travelEngine.getPlayer().getLocation().getName().equalsIgnoreCase("Wald")) {
outputMessage
.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(getLocationMessage(travelEngine) + "\n" + Colors.ANSI_RESET + "Zu den " + Colors.ANSI_BLUE + "blau " + Colors.ANSI_RESET + "markierten Standorten kannst du reisen\n\n")
.append("Deine Karte:\n\n")
.append(" __________________________________________________________________________________________________\n")
.append("| | | |\n")
.append("| | | |\n")
@ -38,8 +38,8 @@ public class MapCommand implements CommandAPI{
.append("|________________________________|________________________________|________________________________|\n");
} else if (travelEngine.getPlayer().getLocation().getName().equalsIgnoreCase("Strand")) {
outputMessage
.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(getLocationMessage(travelEngine) + "\n" + Colors.ANSI_RESET + "Zu den " + Colors.ANSI_BLUE + "blau " + Colors.ANSI_RESET + "markierten Standorten kannst du reisen\n\n")
.append("Deine Karte:\n\n")
.append(" __________________________________________________________________________________________________\n")
.append("| | | |\n")
.append("| | | |\n")
@ -54,8 +54,8 @@ public class MapCommand implements CommandAPI{
} else if (travelEngine.getPlayer().getLocation().getName().equalsIgnoreCase("Berge")) {
outputMessage
.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(getLocationMessage(travelEngine) + "\n" + Colors.ANSI_RESET + "Zu den " + Colors.ANSI_BLUE + "blau " + Colors.ANSI_RESET + "markierten Standorten kannst du reisen\n\n")
.append("Deine Karte:\n\n")
.append(" __________________________________________________________________________________________________\n")
.append("| | | |\n")
.append("| | | |\n")
@ -70,8 +70,8 @@ public class MapCommand implements CommandAPI{
} else if (travelEngine.getPlayer().getLocation().getName().equalsIgnoreCase("Wueste")) {
outputMessage
.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(getLocationMessage(travelEngine) + "\n" + Colors.ANSI_RESET + "Zu den " + Colors.ANSI_BLUE + "blau " + Colors.ANSI_RESET + "markierten Standorten kannst du reisen\n\n")
.append("Deine Karte:\n\n")
.append(" __________________________________________________________________________________________________\n")
.append("| | | |\n")
.append("| | | |\n")
@ -86,8 +86,8 @@ public class MapCommand implements CommandAPI{
} else if (travelEngine.getPlayer().getLocation().getName().equalsIgnoreCase("Gruenland")) {
outputMessage
.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(getLocationMessage(travelEngine) + "\n" + Colors.ANSI_RESET + "Zu den " + Colors.ANSI_BLUE + "blau " + Colors.ANSI_RESET + "markierten Standorten kannst du reisen\n\n")
.append("Deine Karte:\n\n")
.append(" __________________________________________________________________________________________________\n")
.append("| | | |\n")
.append("| | | |\n")
@ -102,8 +102,8 @@ public class MapCommand implements CommandAPI{
} else {
outputMessage
.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(getLocationMessage(travelEngine) + "\n" + Colors.ANSI_RESET + "Zu den " + Colors.ANSI_BLUE + "blau " + Colors.ANSI_RESET + "markierten Standorten kannst du reisen\n\n")
.append("Deine Karte:\n\n")
.append(" __________________________________________________________________________________________________\n")
.append("| | | |\n")
.append("| | | |\n")

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

@ -21,8 +21,8 @@ public class MapCommandTest {
String mapMessage = MapCommand.getMapMessage(outputtest);
StringBuilder outputMessage = new StringBuilder();
outputMessage
.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("Du befindest dich gerade hier: " + Colors.ANSI_GREEN + "Wald" + "\n" + Colors.ANSI_RESET + "Zu den " + Colors.ANSI_BLUE + "blau " + Colors.ANSI_RESET + "markierten Standorten kannst du reisen\n\n")
.append("Deine Karte:\n\n")
.append(" __________________________________________________________________________________________________\n")
.append("| | | |\n")
.append("| | | |\n")
@ -47,8 +47,8 @@ public class MapCommandTest {
String mapMessage = MapCommand.getMapMessage(outputtest);
StringBuilder outputMessage = new StringBuilder();
outputMessage
.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("Du befindest dich gerade hier: " + Colors.ANSI_GREEN + "Strand" + "\n" + Colors.ANSI_RESET + "Zu den " + Colors.ANSI_BLUE + "blau " + Colors.ANSI_RESET + "markierten Standorten kannst du reisen\n\n")
.append("Deine Karte:\n\n")
.append(" __________________________________________________________________________________________________\n")
.append("| | | |\n")
.append("| | | |\n")
@ -73,8 +73,8 @@ public class MapCommandTest {
String mapMessage = MapCommand.getMapMessage(outputtest);
StringBuilder outputMessage = new StringBuilder();
outputMessage
.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("Du befindest dich gerade hier: " + Colors.ANSI_GREEN + "Berge" + "\n" + Colors.ANSI_RESET + "Zu den " + Colors.ANSI_BLUE + "blau " + Colors.ANSI_RESET + "markierten Standorten kannst du reisen\n\n")
.append("Deine Karte:\n\n")
.append(" __________________________________________________________________________________________________\n")
.append("| | | |\n")
.append("| | | |\n")
@ -99,8 +99,8 @@ public class MapCommandTest {
String mapMessage = MapCommand.getMapMessage(outputtest);
StringBuilder outputMessage = new StringBuilder();
outputMessage
.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("Du befindest dich gerade hier: " + Colors.ANSI_GREEN + "Wueste" + "\n" + Colors.ANSI_RESET + "Zu den " + Colors.ANSI_BLUE + "blau " + Colors.ANSI_RESET + "markierten Standorten kannst du reisen\n\n")
.append("Deine Karte:\n\n")
.append(" __________________________________________________________________________________________________\n")
.append("| | | |\n")
.append("| | | |\n")
@ -125,8 +125,8 @@ public class MapCommandTest {
String mapMessage = MapCommand.getMapMessage(outputtest);
StringBuilder outputMessage = new StringBuilder();
outputMessage
.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("Du befindest dich gerade hier: " + Colors.ANSI_GREEN + "Gruenland" + "\n" + Colors.ANSI_RESET + "Zu den " + Colors.ANSI_BLUE + "blau " + Colors.ANSI_RESET + "markierten Standorten kannst du reisen\n\n")
.append("Deine Karte:\n\n")
.append(" __________________________________________________________________________________________________\n")
.append("| | | |\n")
.append("| | | |\n")
@ -151,8 +151,8 @@ public class MapCommandTest {
String mapMessage = MapCommand.getMapMessage(outputtest);
StringBuilder outputMessage = new StringBuilder();
outputMessage
.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("Du befindest dich gerade hier: " + Colors.ANSI_GREEN + "Winterland" + "\n" + Colors.ANSI_RESET + "Zu den " + Colors.ANSI_BLUE + "blau " + Colors.ANSI_RESET + "markierten Standorten kannst du reisen\n\n")
.append("Deine Karte:\n\n")
.append(" __________________________________________________________________________________________________\n")
.append("| | | |\n")
.append("| | | |\n")

Loading…
Cancel
Save