public void MTSPPathTest_Point()
        {
            NetworkAnalyst networkAnalyst = new NetworkAnalyst("http://" + ip + ":8090/iserver/services/transportationanalyst-sample/rest");
            Point2D[] points = new Point2D[4];
            points[0] = new Point2D(119.6100397551, -122.6278394459);
            points[1] = new Point2D(171.9035599945, -113.2491141857);
            points[2] = new Point2D(181.9035599945, -123.2491141857);
            points[3] = new Point2D(161.9035599945, -123.2491141857);
            Point2D[] centerPoints = new Point2D[2];
            centerPoints[0] = new Point2D(111.6100397551, -111.6278394459);
            centerPoints[1] = new Point2D(171.9035599945, -133.2491141857);

            List<MTSPPath<Point2D>> paths = networkAnalyst.FindMTSPPath("RoadNet@Changchun", points, centerPoints, false, null);

            Assert.IsNotNull(paths);
            Assert.IsNotNull(paths[0]);
            Assert.AreEqual(paths[0].StopIndexes[0], 0);
            Assert.AreEqual(paths[1].StopIndexes.Length, 3);
            Assert.AreEqual(paths[0].Center.X, 111.6100397551);
            Assert.AreEqual(paths[1].Center.X, 171.9035599945);
            Assert.AreEqual(paths[0].NodesVisited.Length, 1);
            Assert.AreEqual(paths[1].NodesVisited.Length, 3);
            Assert.IsNotNull(paths[0].EdgeIDs[0]);
            Assert.IsNotNull(paths[0].NodeIDs[0]);
            Assert.IsNotNull(paths[0].Route);
            Assert.IsNotNull(paths[0].Route.Length);
            Assert.IsNotNull(paths[0].Route.Points[0]);
        }
        public void MTSPPathTest_OneID()
        {
            NetworkAnalyst networkAnalyst = new NetworkAnalyst("http://" + ip + ":8090/iserver/services/transportationanalyst-sample/rest");
            int[] nodeIDs = new int[1] { 2 };
            int[] centerIDs = new int[1] { 6 };

            List<MTSPPath<int>> path = networkAnalyst.FindMTSPPath("RoadNet@Changchun", nodeIDs, centerIDs, false, null);

            Assert.AreEqual(path.Count, 1);
            //Assert.AreEqual(path[0].Center);
        }
        public void MTSPPathTest_Patameter()
        {
            NetworkAnalyst networkAnalyst = new NetworkAnalyst("http://" + ip + ":8090/iserver/services/transportationanalyst-sample/rest");
            int[] nodeIDs = new int[5] { 2, 3, 9, 11, 30 };
            int[] centerIDs = new int[2] { 6, 10 };
            TransportationAnalystParameter parameter = new TransportationAnalystParameter();
            parameter.WeightFieldName = "length";
            parameter.TurnWeightField = "TurnCost";
            parameter.ResultSetting = new TransportationAnalystResultSetting();
            parameter.ResultSetting.ReturnEdgeFeatures = true;
            parameter.ResultSetting.ReturnEdgeGeometry = true;
            parameter.ResultSetting.ReturnEdgeIDs = true;
            parameter.ResultSetting.ReturnNodeFeatures = true;
            parameter.ResultSetting.ReturnNodeGeometry = true;
            parameter.ResultSetting.ReturnNodeIDs = true;
            parameter.ResultSetting.ReturnPathGuides = true;
            parameter.ResultSetting.ReturnRoutes = true;


            List<MTSPPath<int>> path = networkAnalyst.FindMTSPPath("RoadNet@Changchun", nodeIDs, centerIDs, false, null);

            Assert.IsNotNull(path);
            Assert.AreEqual(path[0].Center, 6);
            Assert.AreEqual(path[1].Center, 10);
            Assert.AreEqual(path[0].NodesVisited.Length, 4);
            Assert.AreEqual(path[1].NodesVisited.Length, 1);
            Assert.AreEqual(path[0].Weight, 1142);
            Assert.AreEqual(path[1].Weight, 17086);
            Assert.AreEqual(path[0].Route.Type, GeometryType.LINEM);
            Assert.IsNotNull(path[0].NodeIDs);
            Assert.IsNotNull(path[0].EdgeIDs);
            Assert.IsNotNull(path[0].Route);
        }
        public void MTSPPathTest_DatasetNameNull()
        {
            NetworkAnalyst networkAnalyst = new NetworkAnalyst("http://" + ip + ":8090/iserver/services/transportationanalyst-sample/rest");
            int[] nodeIDs = new int[5] { 2, 3, 9, 11, 30 };
            int[] centerIDs = new int[2] { 6, 10 };
            try
            {
                List<MTSPPath<int>> path = networkAnalyst.FindMTSPPath("", nodeIDs, centerIDs, false, null);
            }
            catch (ArgumentNullException e)
            {
                Assert.AreEqual(e.Message, "参数不能为空。\r\n参数名: networkDatasetName");
            }

        }
        public void MTSPPathTest()
        {
            NetworkAnalyst networkAnalyst = new NetworkAnalyst("http://" + ip + ":8090/iserver/services/transportationanalyst-sample/rest");
            int[] nodeIDs = new int[5] { 2, 3, 9, 11, 30 };
            int[] centerIDs = new int[2] { 6, 10 };

            List<MTSPPath<int>> path = networkAnalyst.FindMTSPPath("RoadNet@Changchun", nodeIDs, centerIDs, false, null);

            Assert.IsNotNull(path);
            Assert.AreEqual(path[0].Center, 6);
            Assert.AreEqual(path[1].Center, 10);
            Assert.AreEqual(path[0].NodesVisited.Length, 4);
            Assert.AreEqual(path[1].NodesVisited.Length, 1);
            Assert.AreEqual(path[0].Weight, 1142);
            Assert.AreEqual(path[1].Weight, 17086);
            Assert.AreEqual(path[0].Route.Type, GeometryType.LINEM);
        }