diff --git a/src/main/java/hs/fulda/de/ci/exam/project/FlightSeat.java b/src/main/java/hs/fulda/de/ci/exam/project/FlightSeat.java index 29b33e4..d84c60c 100644 --- a/src/main/java/hs/fulda/de/ci/exam/project/FlightSeat.java +++ b/src/main/java/hs/fulda/de/ci/exam/project/FlightSeat.java @@ -1,10 +1,11 @@ package hs.fulda.de.ci.exam.project; -public class FlightSeat { +public class FlightSeat extends Seat { private String reservationNumer; private double fare; public FlightSeat(double fare, String reservationNumer) { + super(); this.fare = fare; this.reservationNumer = reservationNumer; } diff --git a/src/main/java/hs/fulda/de/ci/exam/project/Seat.java b/src/main/java/hs/fulda/de/ci/exam/project/Seat.java index 8aab462..1967565 100644 --- a/src/main/java/hs/fulda/de/ci/exam/project/Seat.java +++ b/src/main/java/hs/fulda/de/ci/exam/project/Seat.java @@ -10,6 +10,9 @@ public class Seat { this.seatType = seatType; this.seatClass = seatClass; } + public Seat(){ + + } public SeatClass getSeatClass() { return seatClass; diff --git a/src/test/java/hs/fulda/de/ci/exam/project/SeatTest.java b/src/test/java/hs/fulda/de/ci/exam/project/SeatTest.java index a249aca..e9c4400 100644 --- a/src/test/java/hs/fulda/de/ci/exam/project/SeatTest.java +++ b/src/test/java/hs/fulda/de/ci/exam/project/SeatTest.java @@ -19,4 +19,11 @@ public class SeatTest { assertThat(seat.getSeatType()).isEqualTo(SeatType.Regular); assertThat(seat.getSeatClass()).isEqualTo(SeatClass.Economy); } + + @Test + public void testMakingFlightTestParentClass(){ + Seat seat = new FlightSeat(100.0, "1234"); + assertThat(((FlightSeat) seat).getFare()).isEqualTo(100.0); + assertThat(((FlightSeat) seat).getReservationNumber()).isEqualTo("1234"); + } }