|
@ -0,0 +1,29 @@ |
|
|
|
|
|
package hs.fulda.de.ci.exam.project; |
|
|
|
|
|
|
|
|
|
|
|
import org.junit.Test; |
|
|
|
|
|
|
|
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat; |
|
|
|
|
|
|
|
|
|
|
|
public class SeatTest { |
|
|
|
|
|
@Test |
|
|
|
|
|
public void testIfConstructorSetsValues() { |
|
|
|
|
|
FlightSeat fSeat = new FlightSeat(100.0, "1234"); |
|
|
|
|
|
assertThat(fSeat.getFare()).isEqualTo(100.0); |
|
|
|
|
|
assertThat(fSeat.getReservationNumber()).isEqualTo("1234"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
public void testParentSeatClassConstructor() { |
|
|
|
|
|
Seat seat = new Seat("14F", SeatType.Regular, SeatClass.Economy); |
|
|
|
|
|
assertThat(seat.getSeatNumber()).isEqualTo("14F"); |
|
|
|
|
|
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"); |
|
|
|
|
|
} |
|
|
|
|
|
} |