コード例 #1
0
        private string CalculateRouteTotals(string addressesJson, int routeType)
        {
            AddressAdapter addressAdapter = new AddressAdapter();
            var locations = addressAdapter.FindAdresses(addressesJson);
            if (!String.IsNullOrEmpty(addressAdapter.ErrorMessage))
            {
                return addressAdapter.ErrorMessage;
            }

            RouteAdapter routeAdapter = new RouteAdapter();
            var routes = routeAdapter.GenerateRoutes(locations);
            var totals = routeAdapter.Calculate(routes, routeType);

            if (!String.IsNullOrEmpty(routeAdapter.ErrorMessage))
            {
                return routeAdapter.ErrorMessage;
            }

            return routeAdapter.RouteTotalsToJson(totals);
        }
コード例 #2
0
 public void BeforeEach()
 {
     subject = new AddressAdapter();
 }