public async Task GetBargainFinderMaxTest()
        {
            try
            {
                var sessionManager = new SessionManager(_logger);
                var session        = await sessionManager.CreateSession(_credentials, "SessionCreateRQ");

                var client = new SabreApi(_logger);

                //var schedule = await client.GetFlightSchedules(session, GetFlightScheduleRequest());
                //schedule.OTA_AirScheduleRS.OriginDestinationOptions.OriginDestinationOption[0].FlightSegment.Length.Should().BeGreaterThan(1);
                //AirSchedService.OTA_AirScheduleRSOriginDestinationOptionsOriginDestinationOption[] options =
                //    schedule.OTA_AirScheduleRS.OriginDestinationOptions.OriginDestinationOption;
                //AirSchedService.OTA_AirScheduleRSOriginDestinationOptionsOriginDestinationOptionFlightSegment[] segments =
                //    schedule.OTA_AirScheduleRS.OriginDestinationOptions.OriginDestinationOption[0].FlightSegment;

                var req = GetBargainRequest();

                var jss = new JsonSerializerSettings {
                    NullValueHandling = NullValueHandling.Ignore
                };

                var reqSer = JsonConvert.SerializeObject(req, jss);
                _logger.Debug(reqSer);

                var bargainFinderMax = await client.GetBargainFinderMax(session, req);

                //bargainFinderMax.Should().NotBeNull();
                //bargainFinderMax.OTA_AirLowFareSearchRS.Should().NotBeNull();

                var bfmAirLowFareSearchRS = JsonConvert.SerializeObject(bargainFinderMax.OTA_AirLowFareSearchRS);
                _logger.Debug(bfmAirLowFareSearchRS);

                var its = ((BFM.OTA_AirLowFareSearchRSPricedItineraries)bargainFinderMax.OTA_AirLowFareSearchRS.Items.FirstOrDefault(s => s is BFM.OTA_AirLowFareSearchRSPricedItineraries)).PricedItinerary.First();

                foreach (var item in bargainFinderMax.OTA_AirLowFareSearchRS.Items)
                {
                    item.Should().NotBeOfType <BFM.ErrorsType>();
                }

                //foreach (var item in bargainFinderMax.OTA_AirLowFareSearchRS.Items)
                //{
                //    item.Should().NotBeOfType<BFM.ErrorsType>();
                //}
                //var airReq = GetAirBookRequest(its);
                //var schedule = await client.GetAirBook(session, airReq);

                var response = await sessionManager.CloseSession(session);

                response.Should().Be("Approved");
            }
            catch (System.Exception e)
            {
                throw;
            }
        }
        public async Task <BFM.BargainFinderMaxRQResponse> GetBargainFinderMax
        (
            Session session,
            IList <FlightDescription> flightDescriptions,
            string itemsCount,
            BFM.AirTripType tripType
        )
        {
            var req = GetBargainRequest(flightDescriptions, itemsCount, tripType);

            //var bfmReq = JsonConvert.SerializeObject(req, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
            //File.WriteAllText("bfmReq.txt", bfmReq);
            //Process.Start("bfmReq.txt");

            var bargainFinderMax = await _client.GetBargainFinderMax(session, req);

            //var bfmAirLowFareSearchRS = JsonConvert.SerializeObject(bargainFinderMax.OTA_AirLowFareSearchRS, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
            //_logger.Debug(bfmAirLowFareSearchRS);

            return(bargainFinderMax);
        }