Browse Source

Unittest: colored traveloption Winterlandmap

remotes/origin/map
Tanja Herche 2 years ago
parent
commit
113d493594
  1. 4
      src/main/java/org/bitbiome/commands/MapCommand.java
  2. 10
      src/test/java/org/bitbiome/commands/MapCommandTest.java

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

@ -101,12 +101,12 @@ public class MapCommand implements CommandAPI{
.append(" __________________________________________________________________________________________________\n") .append(" __________________________________________________________________________________________________\n")
.append("| | | |\n") .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("| " + Colors.ANSI_BRIGHT_BLACK + locations.getJSONObject(5).getString("name") + Colors.ANSI_RESET + " | " + Colors.ANSI_BLUE + locations.getJSONObject(4).getString("name") + Colors.ANSI_RESET + " | " + Colors.ANSI_BRIGHT_BLACK + locations.getJSONObject(2).getString("name") + Colors.ANSI_RESET + " |" + "\n")
.append("| | | |\n") .append("| | | |\n")
.append("|________________________________|________________________________|________________________________|\n") .append("|________________________________|________________________________|________________________________|\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("| " + Colors.ANSI_BRIGHT_BLACK + locations.getJSONObject(1).getString("name") + Colors.ANSI_RESET + " | " + Colors.ANSI_BRIGHT_BLACK + locations.getJSONObject(0).getString("name") + Colors.ANSI_RESET + " | " + Colors.ANSI_BLUE + locations.getJSONObject(3).getString("name") + Colors.ANSI_RESET + " |" + "\n")
.append("| | | |\n") .append("| | | |\n")
.append("|________________________________|________________________________|________________________________|\n"); .append("|________________________________|________________________________|________________________________|\n");
} }

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

@ -142,11 +142,11 @@ public class MapCommandTest {
assertEquals(outputMessage.toString(), mapMessage); assertEquals(outputMessage.toString(), mapMessage);
} }
@Test @Test
public void testMapCommand() {
public void testWinterlandMapCommand() {
Player Test = new Player("name"); Player Test = new Player("name");
TravelEngine outputtest = new TravelEngine(Test); TravelEngine outputtest = new TravelEngine(Test);
Location Winter = outputtest.getLocationByName("Winterland");
outputtest.travelTo(Winter);
Location Winterland = outputtest.getLocationByName("Winterland");
outputtest.travelTo(Winterland);
String mapMessage = MapCommand.getMapMessage(outputtest); String mapMessage = MapCommand.getMapMessage(outputtest);
StringBuilder outputMessage = new StringBuilder(); StringBuilder outputMessage = new StringBuilder();
outputMessage outputMessage
@ -155,12 +155,12 @@ public class MapCommandTest {
.append(" __________________________________________________________________________________________________\n") .append(" __________________________________________________________________________________________________\n")
.append("| | | |\n") .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("| " + Colors.ANSI_BRIGHT_BLACK + "Wueste" + Colors.ANSI_RESET + " | " + Colors.ANSI_BLUE + "Gruenland" + Colors.ANSI_RESET + " | " + Colors.ANSI_BRIGHT_BLACK + "Winterland" + Colors.ANSI_RESET + " |" + "\n")
.append("| | | |\n") .append("| | | |\n")
.append("|________________________________|________________________________|________________________________|\n") .append("|________________________________|________________________________|________________________________|\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("| " + Colors.ANSI_BRIGHT_BLACK + "Strand" + Colors.ANSI_RESET + " | " + Colors.ANSI_BRIGHT_BLACK + "Wald" + Colors.ANSI_RESET + " | " + Colors.ANSI_BLUE + "Berge" + Colors.ANSI_RESET + " |" + "\n")
.append("| | | |\n") .append("| | | |\n")
.append("|________________________________|________________________________|________________________________|\n"); .append("|________________________________|________________________________|________________________________|\n");

Loading…
Cancel
Save