Browse Source

cancel flight instance todo

feature-flight-instance
Imron 3 years ago
parent
commit
c02ff9a11e
  1. 9
      src/main/java/hs/fulda/de/ci/exam/project/FlightInstance.java
  2. 17
      src/test/java/hs/fulda/de/ci/exam/project/FlightInstanceTest.java
  3. BIN
      target/classes/hs/fulda/de/ci/exam/project/FlightInstance.class

9
src/main/java/hs/fulda/de/ci/exam/project/FlightInstance.java

@ -2,6 +2,8 @@ package hs.fulda.de.ci.exam.project;
import java.sql.Time; import java.sql.Time;
import static hs.fulda.de.ci.exam.project.FlightStatus.Cancelled;
public class FlightInstance { public class FlightInstance {
Time departureTime; Time departureTime;
String gate; String gate;
@ -24,7 +26,12 @@ public class FlightInstance {
public FlightStatus getStatus() { public FlightStatus getStatus() {
return this.status; return this.status;
} }
public void updateStatus(FlightStatus status){
public void updateStatus(FlightStatus status) {
this.status = status; this.status = status;
} }
public boolean cancel() {
return true;
}
} }

17
src/test/java/hs/fulda/de/ci/exam/project/FlightInstanceTest.java

@ -4,8 +4,7 @@ import org.junit.jupiter.api.Test;
import java.sql.Time; import java.sql.Time;
import static hs.fulda.de.ci.exam.project.FlightStatus.Arrived;
import static hs.fulda.de.ci.exam.project.FlightStatus.InAir;
import static hs.fulda.de.ci.exam.project.FlightStatus.*;
import static org.assertj.core.api.Assertions.*; import static org.assertj.core.api.Assertions.*;
class FlightInstanceTest { class FlightInstanceTest {
@ -13,24 +12,30 @@ class FlightInstanceTest {
FlightInstance fInstance1 = new FlightInstance(today, "G15", InAir); FlightInstance fInstance1 = new FlightInstance(today, "G15", InAir);
@Test @Test
void getDepartureTime(){
void getDepartureTime() {
assertThat(fInstance1.getDepartureTime()).describedAs("get departure time of flight isntance").isEqualTo(Time.valueOf("13:45:40")); assertThat(fInstance1.getDepartureTime()).describedAs("get departure time of flight isntance").isEqualTo(Time.valueOf("13:45:40"));
} }
@Test @Test
void getGate(){
void getGate() {
assertThat(fInstance1.getGate()).describedAs("get gate number of flight isntance").isEqualTo("G15"); assertThat(fInstance1.getGate()).describedAs("get gate number of flight isntance").isEqualTo("G15");
} }
@Test @Test
void getStatus(){
void getStatus() {
assertThat(fInstance1.getStatus()).describedAs("get status of flight isntance").isEqualTo(InAir); assertThat(fInstance1.getStatus()).describedAs("get status of flight isntance").isEqualTo(InAir);
} }
@Test @Test
void updateStatus(){
void updateStatus() {
fInstance1.updateStatus(Arrived); fInstance1.updateStatus(Arrived);
assertThat(fInstance1.getStatus()).describedAs("get status of flight isntance").isEqualTo(Arrived); assertThat(fInstance1.getStatus()).describedAs("get status of flight isntance").isEqualTo(Arrived);
} }
@Test
void cancel_FlightInstance() {
// TODO: 26.01.22 discuss
}
} }

BIN
target/classes/hs/fulda/de/ci/exam/project/FlightInstance.class

Loading…
Cancel
Save