From 56fb3c546cb826871798f4688f1a62bfb91d5747 Mon Sep 17 00:00:00 2001 From: David Hermann Date: Wed, 1 Feb 2023 19:51:18 +0100 Subject: [PATCH] unittest: created test for item class This is testing the name of the item --- .../org/bitbiome/entitiesTest/ItemTest.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/test/java/org/bitbiome/entitiesTest/ItemTest.java diff --git a/src/test/java/org/bitbiome/entitiesTest/ItemTest.java b/src/test/java/org/bitbiome/entitiesTest/ItemTest.java new file mode 100644 index 0000000..56335cc --- /dev/null +++ b/src/test/java/org/bitbiome/entitiesTest/ItemTest.java @@ -0,0 +1,23 @@ +package org.bitbiome.entitiesTest; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.bitbiome.entities.Item; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + + +public class ItemTest { + + private static Item item; + + @BeforeAll + public static void setItem() { + item = new Item(); + item.setName("Unit"); + } + + @Test + public void testGetName() { + assertEquals("Unit", item.getName()); + } +}