Browse Source

add aircraft parameters should not be null or negative

feature-pr-Admin
Sona Markosyan 3 years ago
parent
commit
3bf3e0dda8
  1. 13
      src/test/java/hs/fulda/de/ci/exam/project/AdminTest.java

13
src/test/java/hs/fulda/de/ci/exam/project/AdminTest.java

@ -135,4 +135,17 @@ public class AdminTest {
admin.addAircraft("Boeing", "787", 2003);
});
}
@Test
public void addAircraftShouldThrowRuntimeExceptionWhenNull(){
assertThrows(RuntimeException.class, () -> {
admin.addAircraft(null, "787", 2003);
});
assertThrows(RuntimeException.class, () -> {
admin.addAircraft("Boeing", "", 2003);
});
assertThrows(RuntimeException.class, () -> {
admin.addAircraft("Boeing", "787", -2003);
});
}
}
Loading…
Cancel
Save