From 8fa85ab30e09f68eb9550fe59127fcee2ce40c42 Mon Sep 17 00:00:00 2001 From: Imron Date: Mon, 7 Feb 2022 12:19:18 +0100 Subject: [PATCH] FlightSeat --- .../fulda/de/ci/exam/project/FlightSeat.java | 19 +++++++++++++++++++ .../hs/fulda/de/ci/exam/project/SeatTest.java | 14 ++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 src/main/java/hs/fulda/de/ci/exam/project/FlightSeat.java create mode 100644 src/test/java/hs/fulda/de/ci/exam/project/SeatTest.java 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"); + } +}