|
@ -29,7 +29,7 @@ public class NotificationTest { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
public void smsNotificationShouldBeSentWhenSmsTypeIsChosen(){ |
|
|
|
|
|
|
|
|
public void smsNotificationShouldBeSentWhenSmsTypeIsChosen() { |
|
|
FlightReservation reservation = new FlightReservation(); |
|
|
FlightReservation reservation = new FlightReservation(); |
|
|
reservation.setStatus(Confirmed); |
|
|
reservation.setStatus(Confirmed); |
|
|
boolean result = reservation.notifyUser("sms", "01788370107", "Reservation is successfull"); |
|
|
boolean result = reservation.notifyUser("sms", "01788370107", "Reservation is successfull"); |
|
@ -37,9 +37,16 @@ public class NotificationTest { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
public void smsIsSentWhenNumberIsValid(){ |
|
|
|
|
|
|
|
|
public void smsIsSentWhenNumberIsValid() { |
|
|
SmsNotification sms = new SmsNotification("01788370107", "Reservation confirmed"); |
|
|
SmsNotification sms = new SmsNotification("01788370107", "Reservation confirmed"); |
|
|
boolean result = sms.sendNotification(); |
|
|
boolean result = sms.sendNotification(); |
|
|
assertTrue(result); |
|
|
assertTrue(result); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
public void smsShouldNotBeSentWhenNumberIsInvalid() { |
|
|
|
|
|
SmsNotification sms = new SmsNotification("123", "Some Wrong Number"); |
|
|
|
|
|
boolean result = sms.sendNotification(); |
|
|
|
|
|
assertFalse(result); |
|
|
|
|
|
} |
|
|
} |
|
|
} |