Пример #1
0
        public void PrintOutput(List <string> lines)
        {
            var requests = BookingService.BuildSearchRequest(lines);
            var result   = requests.Select(_ => Booking.GetCheapestHotel(_, HotelFactory.GetHotelFactory()));

            foreach (var hotel in result)
            {
                Console.WriteLine($"{hotel.Hotel.Name}");
            }
        }
Пример #2
0
        public void GetCheapestHotel_ValidInput_ReturnCheapestHotelName(string input, string expected)
        {
            //Arrange
            BookingRequest bookingRequest = BookingService.BuildBookingRequest(input);
            IList <Hotel>  defaultHotels  = HotelFactory.GetHotelFactory();

            //Act
            var result = Booking
                         .GetCheapestHotel(bookingRequest, defaultHotels)
                         .Hotel
                         .Name;

            //Assert
            Assert.Equal(result, expected);
        }