Browse Source

unittest: updated item test

This additionally tests whether the item does any damage at all.
remotes/origin/develop
David Hermann 2 years ago
parent
commit
432c37c278
  1. 9
      src/test/java/org/bitbiome/entitiesTest/ItemTest.java

9
src/test/java/org/bitbiome/entitiesTest/ItemTest.java

@ -1,5 +1,6 @@
package org.bitbiome.entitiesTest; package org.bitbiome.entitiesTest;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assumptions.assumeTrue;
import org.bitbiome.entities.Item; import org.bitbiome.entities.Item;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
@ -15,6 +16,7 @@ public class ItemTest {
item = new Item(); item = new Item();
item.setName("Unit"); item.setName("Unit");
item.setDamage(12.5F); item.setDamage(12.5F);
item.changeDoesDamage(true);
} }
@Test @Test
@ -26,4 +28,11 @@ public class ItemTest {
public void testGetDamage() { public void testGetDamage() {
assertEquals(12.5, item.getDamage()); assertEquals(12.5, item.getDamage());
} }
@Test
public void testDoesDamage() {
boolean doesDamage = item.doesDamage();
assumeTrue(item.getDamage() > 0);
assumeTrue(doesDamage);
}
} }
Loading…
Cancel
Save