public void GivenDateRange_ShouldReturn_BestRatedHotelDetails() { //Arrange ReservationSystemBuilder reservationSystem = new ReservationSystemBuilder(); //Act string hotelDetail = reservationSystem.FindBestRatedHotel("13Nov2020", "14Nov2020"); //Assert Assert.AreEqual(hotelDetail, "Ridgewood, Total Rates: $370"); }
public void GivenWrongMonthValue_ShouldThrowCustomException() { //Arrange ReservationSystemBuilder reservationSystem = new ReservationSystemBuilder(); Exception exception = new Exception(); //Act try { string hotelDetail = reservationSystem.FindBestRatedHotel("05Navember2020", "05November2020"); } catch (HotelReservationException e) { exception = e; } //Assert Assert.AreEqual(exception.Message, "Incorrect month value"); }
public void GivenIncorrectDateFormat_ShouldThrowCustomException() { //Arrange ReservationSystemBuilder reservationSystem = new ReservationSystemBuilder(); Exception exception = new Exception(); //Act try { string hotelDetail = reservationSystem.FindBestRatedHotel("SevenNov2020", "NineNov2020"); } catch (HotelReservationException e) { exception = e; } //Assert Assert.AreEqual(exception.Message, "Wrong date format"); }
public void GivenEndDateBeforeStartDate_ShouldThrowCustomException() { //Arrange ReservationSystemBuilder reservationSystem = new ReservationSystemBuilder(); Exception exception = new Exception(); //Act try { string hotelDetail = reservationSystem.FindBestRatedHotel("05Nov2020", "03Nov2020"); } catch (HotelReservationException e) { exception = e; } //Assert Assert.AreEqual(exception.Message, "End date can not be before start date"); }