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)); + } +}