From 29004a278daaa0da7ced915213e767b4d6463565 Mon Sep 17 00:00:00 2001 From: nico Date: Sun, 8 Jan 2023 20:23:36 +0100 Subject: [PATCH] =?UTF-8?q?RobotFactory=20JUnit=20Test=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/RobotFactoryTest.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Robbie-Management-System/src/main/RobotFactoryTest.java diff --git a/Robbie-Management-System/src/main/RobotFactoryTest.java b/Robbie-Management-System/src/main/RobotFactoryTest.java new file mode 100644 index 0000000..5f3683d --- /dev/null +++ b/Robbie-Management-System/src/main/RobotFactoryTest.java @@ -0,0 +1,19 @@ +package main; + +import static org.junit.jupiter.api.Assertions.*; + +import org.junit.jupiter.api.Test; + +import domain.RobotType; + +class RobotFactoryTest { + + @Test + void testRobotFactory() { + assertEquals(10000, RobotFactory.robotFactory(RobotType.C3PO, "Test").getId()); + assertEquals("Test", RobotFactory.robotFactory(RobotType.C3PO, "Test").getName()); + assertEquals(0, RobotFactory.robotFactory(RobotType.R2D2, "Tes2t").getId()); + assertEquals("Test2", RobotFactory.robotFactory(RobotType.R2D2, "Test2").getName()); + assertTrue(RobotFactory.robotFactory(RobotType.NEXUS6, "Tes2t") == null); + } +}