public void HotelRate_adults_is_excel_summary_adults()
        {
            var hotelRate = GetFakeHotelRate(false);
            var mapper    = new HotelRateMapper();

            var excelSummary = mapper.MapHotelRateToExcelSummary(hotelRate);

            excelSummary.Adults.Should().Be(hotelRate.Adults);
        }
        public void HotelRate_rate_name_is_excel_summary_rate_name()
        {
            var hotelRate = GetFakeHotelRate(false);
            var mapper    = new HotelRateMapper();

            var excelSummary = mapper.MapHotelRateToExcelSummary(hotelRate);

            excelSummary.RateName.Should().Be(hotelRate.RateName);
        }
        public void HotelRate_price_currency_is_excel_summary_currency()
        {
            var hotelRate = GetFakeHotelRate(false);
            var mapper    = new HotelRateMapper();

            var excelSummary = mapper.MapHotelRateToExcelSummary(hotelRate);

            excelSummary.Currency.Should().Be(hotelRate.Price.Currency);
        }
        public void HotelRate_targetday_date_is_excel_summary_arrival_date()
        {
            var hotelRate    = GetFakeHotelRate(false);
            var mapper       = new HotelRateMapper();
            var expectedDate = hotelRate.TargetDay.Date;

            var excelSummary = mapper.MapHotelRateToExcelSummary(hotelRate);

            excelSummary.ArrivalDate.Should().Be(expectedDate);
        }
        public void Excel_summary_breakfast_is_hotelrate_breakfast_rate_tag_shape(bool breakfastIncluded)
        {
            var hotelRate = GetFakeHotelRate(breakfastIncluded);
            var mapper    = new HotelRateMapper();
            var expectedBreakfastIncluded = breakfastIncluded ? 1 : 0;

            var excelSummary = mapper.MapHotelRateToExcelSummary(hotelRate);

            excelSummary.BreakfastIncluded.Should().Be(expectedBreakfastIncluded);
        }
        public void Excel_summary_price_is_hotelrate_price_numeric_float()
        {
            var hotelRate     = GetFakeHotelRate(false);
            var mapper        = new HotelRateMapper();
            var expectedPrice = hotelRate.Price.NumericFloat;

            var excelSummary = mapper.MapHotelRateToExcelSummary(hotelRate);

            excelSummary.Price.Should().Be(expectedPrice);
        }
        public void Excel_summary_departure_date_is_hotelrate_targetday_plus_los()
        {
            var hotelRate             = GetFakeHotelRate(false);
            var mapper                = new HotelRateMapper();
            var expectedDepartureDate = hotelRate.TargetDay.Date.AddDays(hotelRate.Los).Date;

            var excelSummary = mapper.MapHotelRateToExcelSummary(hotelRate);

            excelSummary.DepartureDate.Should().Be(expectedDepartureDate);
        }
示例#8
0
 public ExcelReportGenerator(IHotelRateRepository hotelRateRepo, HotelRateMapper mapper, IOptions <ExcelSettingsOptions> excelOptions)
 {
     _hotelRateRepo   = hotelRateRepo;
     _hotelRateMapper = mapper;
     _excelSettings   = excelOptions.Value;
 }