From 9acf819d35f8df525d081dcd1d8992c28b79c0c0 Mon Sep 17 00:00:00 2001 From: David Hermann Date: Wed, 1 Feb 2023 20:13:52 +0100 Subject: [PATCH] unittest: created test for player class This tests the name of the player --- .../org/bitbiome/entitiesTest/PlayerTest.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/test/java/org/bitbiome/entitiesTest/PlayerTest.java diff --git a/src/test/java/org/bitbiome/entitiesTest/PlayerTest.java b/src/test/java/org/bitbiome/entitiesTest/PlayerTest.java new file mode 100644 index 0000000..4f9d885 --- /dev/null +++ b/src/test/java/org/bitbiome/entitiesTest/PlayerTest.java @@ -0,0 +1,26 @@ +package org.bitbiome.entitiesTest; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.bitbiome.entities.Player; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +public class PlayerTest { + + private static Player player; + + @BeforeAll + public static void setPlayer() { + player = new Player(); + + player.setName("UnitPlayer"); + + } + + @Test + public void testPlayerName() { + assertEquals("UnitPlayer", player.getName()); + } + +}