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 new file mode 100644 index 0000000..29b33e4 --- /dev/null +++ b/src/main/java/hs/fulda/de/ci/exam/project/FlightSeat.java @@ -0,0 +1,19 @@ +package hs.fulda.de.ci.exam.project; + +public class FlightSeat { + private String reservationNumer; + private double fare; + + public FlightSeat(double fare, String reservationNumer) { + this.fare = fare; + this.reservationNumer = reservationNumer; + } + + public double getFare() { + return this.fare; + } + + public String getReservationNumber() { + return this.reservationNumer; + } +} 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 new file mode 100644 index 0000000..b48e261 --- /dev/null +++ b/src/test/java/hs/fulda/de/ci/exam/project/SeatTest.java @@ -0,0 +1,14 @@ +package hs.fulda.de.ci.exam.project; + +import org.junit.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +public class SeatTest { + @Test + void testIfConstructorSetsValues() { + FlightSeat fSeat = new FlightSeat(100.0, "1234"); + assertThat(fSeat.getFare()).isEqualTo(100.0); + assertThat(fSeat.getReservationNumber()).isEqualTo("1234"); + } +}