コード例 #1
0
        private IEnumerable <VehicleResponse> GetVehicleStatusesFromHoneyBadgerIfNecessary(IBSOrderInformation[] orderStatuses, string market)
        {
            var isLocalMarketAndConfigured = !market.HasValue() &&
                                             _serverSettings.ServerData.HoneyBadger.AvailableVehiclesMarket.HasValue() &&
                                             _serverSettings.ServerData.LocalAvailableVehiclesMode == LocalAvailableVehiclesModes.HoneyBadger;

            var isExternalMarketAndConfigured = market.HasValue() &&
                                                _serverSettings.ServerData.ExternalAvailableVehiclesMode == ExternalAvailableVehiclesModes.HoneyBadger;

            if (isLocalMarketAndConfigured || isExternalMarketAndConfigured)
            {
                var vehicleMedallions = orderStatuses.Select(x => x.VehicleNumber);
                var vehicleMarket     = !market.HasValue()
                    ? _serverSettings.ServerData.HoneyBadger.AvailableVehiclesMarket // Local market
                    : market;                                                        // External market

                // Get vehicle statuses/position from HoneyBadger
                return(_honeyBadgerServiceClient.GetVehicleStatus(vehicleMarket, vehicleMedallions));
            }
            else
            {
                Log.DebugFormat("UpdateOrderStatusJob.GetVehicleStatusesFromHoneyBadgerIfNecessary: isLocalMarketAndConfigured: {0}, isExternalMarketAndConfigured: {1}", isLocalMarketAndConfigured, isExternalMarketAndConfigured);
            }

            return(new VehicleResponse[0]);
        }
コード例 #2
0
        public void when_getting_the_status_of_a_vehicle()
        {
            var vehicles = _sut.GetAvailableVehicles("BOS", 42.354045, -71.062289);

            Assert.IsNotEmpty(vehicles);

            var vehicleId = vehicles.First().Medallion;

            var vehicleStatus = _sut.GetVehicleStatus("BOS", new[] { vehicleId });

            Assert.IsNotEmpty(vehicleStatus);
        }