public static BSHotelAvailability GetPerfect(AvailabilityRateType rateType, int nights) { var av = new BSHotelAvailability { Name = EmulateDtosAndModelsValues.HOTEL_NAME }; av.AddRate(EmulateDtosAndModelsValues.RATE_NAME_1, GetPrice(rateType, nights)); return(av); }
public static RateDto GetRate(string boarTypeName, AvailabilityRateType rateType, bool isValid = true) { return(new RateDto { rateType = rateType.ToString(), boardType = boarTypeName, value = isValid ? EmulateDtosAndModelsValues.RATE_PRICE : -1 }); }
private static BSAvailabilityDto GetPerfect(AvailabilityRateType rateType) { return(new BSAvailabilityDto { hotel = GetHotel(), rates = new List <RateDto>() { GetRate(EmulateDtosAndModelsValues.RATE_NAME_1, rateType) } }); }
public static BSAvailabilityDto GetAvailabilityDtoByType(DtoTypes dtoType, AvailabilityRateType rateType = AvailabilityRateType.Stay) { switch (dtoType) { case DtoTypes.Perfect: return(GetPerfect(rateType)); case DtoTypes.Huggly: return(GetWithBadBoardPrice()); case DtoTypes.BadName: return(GetBadHotelName()); case DtoTypes.BadPrice: return(GetWithBadBoardPrice(false)); } return(null); }
private static decimal GetPrice(AvailabilityRateType rateType, int nights) { return(EmulateDtosAndModelsValues.RATE_PRICE * (rateType == AvailabilityRateType.PerNight ? nights : 1)); }