Browse Source

Edited helpcommand

Added quiz and blackjack
remotes/origin/develop
David Hermann 2 years ago
parent
commit
e84c2f9b75
  1. 4
      src/main/java/org/bitbiome/commands/HelpCommand.java
  2. 18
      src/test/java/org/bitbiome/commands/HelpCommandTest.java

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

@ -27,6 +27,10 @@ public class HelpCommand implements CommandAPI {
.append("|--------------|-----------------------------|\n") .append("|--------------|-----------------------------|\n")
.append("|" + Colors.ANSI_GREEN + " travel" + Colors.ANSI_RESET + " | Startet das Reise System |\n") .append("|" + Colors.ANSI_GREEN + " travel" + Colors.ANSI_RESET + " | Startet das Reise System |\n")
.append("|--------------|-----------------------------|\n") .append("|--------------|-----------------------------|\n")
.append("|" + Colors.ANSI_GREEN + " quiz" + Colors.ANSI_RESET + " | Startet das quiz im shop |\n")
.append("|--------------|-----------------------------|\n")
.append("|" + Colors.ANSI_GREEN + " blackjack" + Colors.ANSI_RESET + " | Startet blackjack im shop |\n")
.append("|--------------|-----------------------------|\n")
.append("|" + Colors.ANSI_GREEN + " location" + Colors.ANSI_RESET + " | Gibt deine Location aus |\n") .append("|" + Colors.ANSI_GREEN + " location" + Colors.ANSI_RESET + " | Gibt deine Location aus |\n")
.append("|______________|_____________________________|\n"); .append("|______________|_____________________________|\n");

18
src/test/java/org/bitbiome/commands/HelpCommandTest.java

@ -1,8 +1,7 @@
package org.bitbiome.commands; package org.bitbiome.commands;
import org.bitbiome.classes.Colors;
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.assertTrue;
public class HelpCommandTest { public class HelpCommandTest {
@ -10,20 +9,7 @@ public class HelpCommandTest {
@Test @Test
public void testHelpCommand() { public void testHelpCommand() {
String helpMessage = HelpCommand.getHelpMessage(); String helpMessage = HelpCommand.getHelpMessage();
StringBuilder outputMessage = new StringBuilder();
outputMessage
.append("|______________|_____________________________|\n")
.append("|" + Colors.ANSI_PURPLE + " Command" + Colors.ANSI_RESET + " | " + Colors.ANSI_PURPLE + "Description" + Colors.ANSI_RESET + " |\n")
.append("|--------------|-----------------------------|\n")
.append("|" + Colors.ANSI_GREEN + " help" + Colors.ANSI_RESET + " | Gibt diese Nachricht aus |\n")
.append("|--------------|-----------------------------|\n")
.append("|" + Colors.ANSI_GREEN + " exit/quit" + Colors.ANSI_RESET + " | Beendet das Spiel |\n")
.append("|--------------|-----------------------------|\n")
.append("|" + Colors.ANSI_GREEN + " travel" + Colors.ANSI_RESET + " | Startet das Reise System |\n")
.append("|--------------|-----------------------------|\n")
.append("|" + Colors.ANSI_GREEN + " location" + Colors.ANSI_RESET + " | Gibt deine Location aus |\n")
.append("|______________|_____________________________|\n");
assertEquals(outputMessage.toString(), helpMessage);
assertTrue(helpMessage.contains("Command") && helpMessage.contains("Description"));
} }

Loading…
Cancel
Save