Erste SystemTests angelegt

master
Milan Lukic 2023-01-06 16:00:10 +01:00
parent 0ff589db10
commit 8ca77ecf35
1 changed files with 36 additions and 0 deletions

View File

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