From 432c37c27826acabcada79ed58222c9d7147af9f Mon Sep 17 00:00:00 2001 From: David Hermann Date: Wed, 1 Feb 2023 20:07:24 +0100 Subject: [PATCH] unittest: updated item test This additionally tests whether the item does any damage at all. --- src/test/java/org/bitbiome/entitiesTest/ItemTest.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/test/java/org/bitbiome/entitiesTest/ItemTest.java b/src/test/java/org/bitbiome/entitiesTest/ItemTest.java index ef6093c..4214043 100644 --- a/src/test/java/org/bitbiome/entitiesTest/ItemTest.java +++ b/src/test/java/org/bitbiome/entitiesTest/ItemTest.java @@ -1,5 +1,6 @@ package org.bitbiome.entitiesTest; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assumptions.assumeTrue; import org.bitbiome.entities.Item; import org.junit.jupiter.api.BeforeAll; @@ -15,6 +16,7 @@ public class ItemTest { item = new Item(); item.setName("Unit"); item.setDamage(12.5F); + item.changeDoesDamage(true); } @Test @@ -26,4 +28,11 @@ public class ItemTest { public void testGetDamage() { assertEquals(12.5, item.getDamage()); } + + @Test + public void testDoesDamage() { + boolean doesDamage = item.doesDamage(); + assumeTrue(item.getDamage() > 0); + assumeTrue(doesDamage); + } }