diff --git a/src/test/java/hs/fulda/de/ci/exam/project/AdminTest.java b/src/test/java/hs/fulda/de/ci/exam/project/AdminTest.java index 45930a0..4d9653b 100644 --- a/src/test/java/hs/fulda/de/ci/exam/project/AdminTest.java +++ b/src/test/java/hs/fulda/de/ci/exam/project/AdminTest.java @@ -86,6 +86,23 @@ public class AdminTest { }); } + @Test + public void shouldThrowRuntimeExceptionWhenNull(){ + + assertThrows(RuntimeException.class, () -> { + admin.addFlight(null, airport_fr, airport1_ist, 140); + }); + assertThrows(RuntimeException.class, () -> { + admin.addFlight("1", null, airport1_ist, 140); + }); + assertThrows(RuntimeException.class, () -> { + admin.addFlight("1", airport_fr, null, 140); + }); + assertThrows(RuntimeException.class, () -> { + admin.addFlight("1", airport_fr, airport1_ist, -40); + }); + } + }