Browse Source

Added test for testUseItem() (Player version)

remotes/origin/fight-engine
fdai7430 2 years ago
parent
commit
ac09973e1f
  1. 11
      src/test/java/org/bitbiome/commands/UseCommandTest.java

11
src/test/java/org/bitbiome/commands/UseCommandTest.java

@ -26,6 +26,17 @@ public class UseCommandTest {
assertEquals(0, player.getLocation().getMobList().size()); assertEquals(0, player.getLocation().getMobList().size());
} }
@Test
public void testUseItemPlayer() {
UseCommand com = new UseCommand();
Player player = new Player("test");
Item sword = new Item("Sword", true, 10);
assertEquals("You used Sword on yourself", com.useItem(sword, player));
assertEquals(90, player.getHp());
Item sword2 = new Item("Heiliges Schwert der Engel", true, 1000);
assertEquals("You used Heiliges Schwert der Engel on yourself and died.", com.useItem(sword2, player));
}
@Test @Test
public void testGetUseMessage() { public void testGetUseMessage() {
UseCommand com = new UseCommand(); UseCommand com = new UseCommand();

Loading…
Cancel
Save