|
@ -135,4 +135,17 @@ public class AdminTest { |
|
|
admin.addAircraft("Boeing", "787", 2003); |
|
|
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); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
} |
|
|
} |