예제 #1
0
        public void UpdateRouteTest()
        {
            var route4Me = new Route4MeManagerV5(c_ApiKey);

            tdr.SD10Stops_route.Parameters.DistanceUnit = DistanceUnit.KM.Description();
            tdr.SD10Stops_route.Parameters.Parts        = 2;
            tdr.SD10Stops_route.Parameters = null;
            var addresses = new List <Address>();

            tdr.SD10Stops_route.Addresses[2].SequenceNo      = 4;
            tdr.SD10Stops_route.Addresses[2].Alias           = "Address 2";
            tdr.SD10Stops_route.Addresses[2].AddressStopType = AddressStopType.Delivery.Description();
            addresses.Add(tdr.SD10Stops_route.Addresses[2]);

            tdr.SD10Stops_route.Addresses[3].SequenceNo      = 3;
            tdr.SD10Stops_route.Addresses[3].Alias           = "Address 3";
            tdr.SD10Stops_route.Addresses[3].AddressStopType = AddressStopType.PickUp.Description();
            addresses.Add(tdr.SD10Stops_route.Addresses[3]);

            tdr.SD10Stops_route.Addresses = addresses.ToArray();

            var updatedRoute = route4Me.UpdateRoute(tdr.SD10Stops_route, out ResultResponse resultResponse);

            Assert.NotNull(updatedRoute);
            Assert.IsType <DataObjectRoute>(updatedRoute);
        }