|
@ -2,20 +2,52 @@ package org.bitbiome.commands; |
|
|
|
|
|
|
|
|
import org.bitbiome.classes.Colors; |
|
|
import org.bitbiome.classes.Colors; |
|
|
import org.bitbiome.classes.TravelEngine; |
|
|
import org.bitbiome.classes.TravelEngine; |
|
|
|
|
|
import org.bitbiome.entities.Location; |
|
|
|
|
|
import org.bitbiome.entities.Mob; |
|
|
import org.bitbiome.entities.Player; |
|
|
import org.bitbiome.entities.Player; |
|
|
import org.junit.jupiter.api.Test; |
|
|
import org.junit.jupiter.api.Test; |
|
|
import static org.junit.jupiter.api.Assertions.assertEquals; |
|
|
import static org.junit.jupiter.api.Assertions.assertEquals; |
|
|
import static org.junit.jupiter.api.Assertions.assertTrue; |
|
|
import static org.junit.jupiter.api.Assertions.assertTrue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class MapCommandTest { |
|
|
public class MapCommandTest { |
|
|
|
|
|
@Test |
|
|
|
|
|
public void testWaldMapCommand() { |
|
|
|
|
|
Player Test = new Player("name"); |
|
|
|
|
|
TravelEngine outputtest = new TravelEngine(Test); |
|
|
|
|
|
Location Wald = outputtest.getLocationByName("Wald"); |
|
|
|
|
|
outputtest.travelTo(Wald); |
|
|
|
|
|
String mapMessage = MapCommand.getMapMessage(outputtest); |
|
|
|
|
|
StringBuilder outputMessage = new StringBuilder(); |
|
|
|
|
|
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 + "Deine Karte:\n\n" + Colors.ANSI_RESET) |
|
|
|
|
|
.append(" __________________________________________________________________________________________________\n") |
|
|
|
|
|
.append("| | | |\n") |
|
|
|
|
|
.append("| | | |\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("| " + Colors.ANSI_BLUE + "Strand" + Colors.ANSI_RESET + " | " + Colors.ANSI_BRIGHT_BLACK + "Wald" + Colors.ANSI_RESET + " | " + Colors.ANSI_BLUE + "Berge" + Colors.ANSI_RESET + " |" + "\n") |
|
|
|
|
|
.append("| | | |\n") |
|
|
|
|
|
.append("|________________________________|________________________________|________________________________|\n"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assertEquals(outputMessage.toString(), mapMessage); |
|
|
|
|
|
} |
|
|
@Test |
|
|
@Test |
|
|
public void testMapCommand() { |
|
|
public void testMapCommand() { |
|
|
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); |
|
|
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" + Colors.ANSI_RESET) |
|
|
|
|
|
|
|
|
.append(Colors.ANSI_BLUE + "Du befindest dich gerade hier: Winterland" + "\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") |
|
@ -33,3 +65,4 @@ public class MapCommandTest { |
|
|
assertEquals(outputMessage.toString(), mapMessage); |
|
|
assertEquals(outputMessage.toString(), mapMessage); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|