Browse Source

add flight throws RuntimeException when null or negative duration

feature-pr-Admin
Sona Markosyan 2 years ago
parent
commit
72e15e81e5
  1. 17
      src/test/java/hs/fulda/de/ci/exam/project/AdminTest.java

17
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);
});
}
}
Loading…
Cancel
Save