|
@ -47,10 +47,10 @@ public class ItineraryTest { |
|
|
|
|
|
|
|
|
when(person1.getItineraries()).thenReturn(itineraries); |
|
|
when(person1.getItineraries()).thenReturn(itineraries); |
|
|
|
|
|
|
|
|
boolean actualWithCredit = item1.makePayment("Credit", person1, 450); |
|
|
|
|
|
boolean actualWithCash = item1.makePayment("Cash", person1, 450); |
|
|
|
|
|
boolean actualWithCheck = item1.makePayment("Check", person1, 450); |
|
|
|
|
|
boolean actualEmpty = item1.makePayment(" ", person1, 450); |
|
|
|
|
|
|
|
|
boolean actualWithCredit = item1.makePayment(new FlightReservation(),"Credit", person1, 450); |
|
|
|
|
|
boolean actualWithCash = item1.makePayment(new FlightReservation(), "Cash", person1, 450); |
|
|
|
|
|
boolean actualWithCheck = item1.makePayment(new FlightReservation(), "Check", person1, 450); |
|
|
|
|
|
boolean actualEmpty = item1.makePayment(new FlightReservation(), " ", person1, 450); |
|
|
|
|
|
|
|
|
assertEquals(true, actualWithCash, "The Payment method is successfully chosen"); |
|
|
assertEquals(true, actualWithCash, "The Payment method is successfully chosen"); |
|
|
assertEquals(true, actualWithCash, "The Payment method is successfully chosen"); |
|
|
assertEquals(true, actualWithCash, "The Payment method is successfully chosen"); |
|
@ -59,6 +59,13 @@ public class ItineraryTest { |
|
|
assertEquals(false, actualEmpty, "The Payment method is wrong"); |
|
|
assertEquals(false, actualEmpty, "The Payment method is wrong"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
public void test_makePaymentStatus(){ |
|
|
|
|
|
FlightReservation flightReservation = new FlightReservation(); |
|
|
|
|
|
item1.makePayment(flightReservation,"Credit", person1, 450); |
|
|
|
|
|
assertEquals(flightReservation.getStatus(), ReservationStatus.Pending); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
@DisplayName("Should Not Make Reservation when Passenger name is null") |
|
|
@DisplayName("Should Not Make Reservation when Passenger name is null") |
|
|
public void shouldThrowRuntimeExceptionWhenNameIsNull() { |
|
|
public void shouldThrowRuntimeExceptionWhenNameIsNull() { |
|
|