Weitere SystemTests
parent
8ca77ecf35
commit
b56e302e37
|
@ -5,7 +5,11 @@ import static org.junit.jupiter.api.Assertions.*;
|
|||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import tpe.exceptions.roboter.exceptions.RobotException;
|
||||
import tpe.exceptions.roboter.exceptions.RobotIllegalStateException;
|
||||
|
||||
class SystemTest {
|
||||
|
||||
private static Factorysystem fs;
|
||||
@BeforeAll
|
||||
static void initFactorysystem() {
|
||||
|
@ -33,4 +37,31 @@ class SystemTest {
|
|||
fs.schalterBetätigen(id);
|
||||
assertTrue(fs.zustandRoboter(id));
|
||||
}
|
||||
|
||||
@Test
|
||||
void fehlerAuslesenTest() {
|
||||
int id = fs.roboterAnlegen("Test", 1);
|
||||
assertNull(fs.fehlerAuslesen(id));
|
||||
int [] zahlen = {5,4,6,2,1};
|
||||
try {
|
||||
fs.sprechenAufruf(id, zahlen);
|
||||
} catch (RobotException e) {
|
||||
}
|
||||
assertNotNull(fs.fehlerAuslesen(id));
|
||||
|
||||
}
|
||||
@Test
|
||||
void sprechenTest() throws RobotException {
|
||||
int id = fs.roboterAnlegen("Test", 1);
|
||||
int id2 = fs.roboterAnlegen("Test2", 2);
|
||||
|
||||
fs.schalterBetätigen(id);
|
||||
fs.schalterBetätigen(id2);
|
||||
int [] zahlen = {5,9,1,6};
|
||||
|
||||
assertEquals("1, 5, 6, 9, ", fs.sprechenAufruf(id, zahlen));
|
||||
assertEquals("9; 6; 5; 1; ", fs.sprechenAufruf(id2, zahlen));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue