Browse Source

FlightSeat

feature-pr-seatFlightSeat
Imron 3 years ago
parent
commit
8fa85ab30e
  1. 19
      src/main/java/hs/fulda/de/ci/exam/project/FlightSeat.java
  2. 14
      src/test/java/hs/fulda/de/ci/exam/project/SeatTest.java

19
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;
}
}

14
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");
}
}
Loading…
Cancel
Save