From 8ca77ecf35641ca12b6c165d8ae230756c8e5ebe Mon Sep 17 00:00:00 2001 From: Milan Lukic <2122158@stud.hs-mannheim.de> Date: Fri, 6 Jan 2023 16:00:10 +0100 Subject: [PATCH] Erste SystemTests angelegt --- Roboterfabrik/src/facade/SystemTest.java | 36 ++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Roboterfabrik/src/facade/SystemTest.java diff --git a/Roboterfabrik/src/facade/SystemTest.java b/Roboterfabrik/src/facade/SystemTest.java new file mode 100644 index 0000000..5b85e12 --- /dev/null +++ b/Roboterfabrik/src/facade/SystemTest.java @@ -0,0 +1,36 @@ +package facade; + +import static org.junit.jupiter.api.Assertions.*; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +class SystemTest { + private static Factorysystem fs; + @BeforeAll + static void initFactorysystem() { + fs = new Factorysystem("Test"); + } + @Test + void smokeTest() { + assertNotNull(fs); + + } + + @Test + void roboterAnlegenTest() { + int id = fs.roboterAnlegen("Test", 1); + int id2 = fs.roboterAnlegen("Test2", 2); + assertEquals("RoboterType: " + "R2D2" + "; Name: " +"Test" + "; Seriennummer: " + id,fs.roboterDaten(id)); + assertEquals("RoboterType: " + "C3PO" + "; Name: " +"Test2" + "; Seriennummer: " + id2,fs.roboterDaten(id2)); + assertEquals("RoboterType: " + "NEXUS6" + "; Name: " +"Pris" + "; Seriennummer: " + 19281982,fs.roboterDaten(19281982)); + } + + @Test + void zustandTest() { + int id = fs.roboterAnlegen("Test", 1); + assertFalse(fs.zustandRoboter(id)); + fs.schalterBetätigen(id); + assertTrue(fs.zustandRoboter(id)); + } +}