|
@ -6,6 +6,7 @@ import java.sql.Time; |
|
|
import java.util.HashSet; |
|
|
import java.util.HashSet; |
|
|
|
|
|
|
|
|
import static hs.fulda.de.ci.exam.project.FlightStatus.Active; |
|
|
import static hs.fulda.de.ci.exam.project.FlightStatus.Active; |
|
|
|
|
|
import static hs.fulda.de.ci.exam.project.FlightStatus.Cancelled; |
|
|
import static org.assertj.core.api.Assertions.assertThat; |
|
|
import static org.assertj.core.api.Assertions.assertThat; |
|
|
import static org.junit.jupiter.api.Assertions.assertTrue; |
|
|
import static org.junit.jupiter.api.Assertions.assertTrue; |
|
|
|
|
|
|
|
@ -48,6 +49,16 @@ class FlightTest { |
|
|
assertThat(expected).isEqualTo(result); |
|
|
assertThat(expected).isEqualTo(result); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
void cancelingFlightShouldChangeActiveToCancelled() { |
|
|
|
|
|
boolean addInstance = flight1.addFlightSchedule(fInstance1); |
|
|
|
|
|
assertTrue(addInstance); |
|
|
|
|
|
flight1.cancel(fInstance1); |
|
|
|
|
|
FlightStatus result = flight1.getFlightInstance(fInstance1).getStatus(); |
|
|
|
|
|
FlightStatus expected = Cancelled; |
|
|
|
|
|
assertThat(expected).isEqualTo(result); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
void getFlightNumber() { |
|
|
void getFlightNumber() { |
|
|
assertThat(flight1.getFlightNumber()).describedAs("get flight number of the flight").isEqualTo("1"); |
|
|
assertThat(flight1.getFlightNumber()).describedAs("get flight number of the flight").isEqualTo("1"); |
|
|