Browse Source

unittest: added testGetMobsOutputWithMobs()

remotes/origin/Julia
Juliakn66 2 years ago
parent
commit
d704d962a8
  1. 15
      src/test/java/org/bitbiome/commands/LookaroundCommandTest.java

15
src/test/java/org/bitbiome/commands/LookaroundCommandTest.java

@ -91,4 +91,19 @@ public class LookaroundCommandTest {
String expectedOutput = "Hier gibt es leider nichts für dich zum Einsammeln.\n";
assertEquals(expectedOutput, outputMessage.toString());
}
@Test
public void testGetMobsOutputWithMobs() {
LookaroundCommand command = new LookaroundCommand();
int randomNumberMobs = 2;
int randomNumberItems = 0;
StringBuilder outputMessage = new StringBuilder();
ArrayList<Mob> foundMobs = new ArrayList<>();
foundMobs.add(new Mob("Big Foot", true, 50, 15));
foundMobs.add(new Mob("Yeti", false, 70, 30));
command.getMobsOutput( randomNumberItems,randomNumberMobs, outputMessage, foundMobs);
String expectedOutput = "Achtung, hier lauern Gefahren! Sei auf der Hut vor: \n- Big Foot\n- Yeti\n";
assertEquals(expectedOutput, outputMessage.toString());
}
}
Loading…
Cancel
Save