コード例 #1
0
        public void ShouldDeleteAnExistentFeatureInTheSampleFeatureServiceAtArcGISOnline()
        {
            List <RestAPIOperationResponseBase> responseList;
            var featuresList = CreateFeaturesList();
            var testName     = featuresList[0].Attributes.Name;

            var restAPIConnector = new RestAPIFeatureServiceConnector <RestAPIFeature <Polygon, RestAPITestAttributeModel>, Polygon, RestAPITestAttributeModel>(TEST_FEATURE_URL);
            var sucessAdd        = restAPIConnector.AddFeatures(featuresList, out responseList);

            sucessAdd.Should().Be.True();

            var result = restAPIConnector.QueryFeaturesByWhereClause(string.Format("name='{0}'", testName));

            result.Should().Not.Be.Null();
            result[0].Attributes.Name.Should().Be(testName);

            var featuresToDelete = new List <long> {
                result[0].Attributes.ID
            };

            var sucessDelete = restAPIConnector.DeleteFeatures(featuresToDelete, out responseList);

            sucessDelete.Should().Be.True();

            var result2 = restAPIConnector.QueryFeaturesByWhereClause(string.Format("name='{0}'", testName));

            result2.Should().Not.Be.Null();
            result2.Count.Should().Be(0);
        }
		public void ShouldCreateANewFeatureInTheSampleFeatureServiceAtArcGISOnline()
		{
			List<RestAPIOperationResponseBase> responseList;
			var featuresToAddList = CreateFeaturesList();
			var testName = featuresToAddList[0].Attributes.Name;

			var restAPIConnector = new RestAPIFeatureServiceConnector<RestAPIFeature<Polygon, RestAPITestAttributeModel>, Polygon, RestAPITestAttributeModel>(TEST_FEATURE_URL);
			var sucess = restAPIConnector.AddFeatures(featuresToAddList, out responseList);

			sucess.Should().Be.True();
			responseList.Should().Not.Be.Null();
			responseList.Count.Should().Be(1);
			responseList.ForEach(x => x.Success.Should().Be.True());

			var result = restAPIConnector.QueryFeaturesByWhereClause(string.Format("name='{0}'", testName));
			result.Should().Not.Be.Null();
			result.Count.Should().Be(1);
			result[0].Attributes.Name.Should().Be(testName);
			result[0].Attributes.Description.Should().Be(testName);
		}
コード例 #3
0
        public void ShouldCreateANewFeatureInTheSampleFeatureServiceAtArcGISOnline()
        {
            List <RestAPIOperationResponseBase> responseList;
            var featuresToAddList = CreateFeaturesList();
            var testName          = featuresToAddList[0].Attributes.Name;

            var restAPIConnector = new RestAPIFeatureServiceConnector <RestAPIFeature <Polygon, RestAPITestAttributeModel>, Polygon, RestAPITestAttributeModel>(TEST_FEATURE_URL);
            var sucess           = restAPIConnector.AddFeatures(featuresToAddList, out responseList);

            sucess.Should().Be.True();
            responseList.Should().Not.Be.Null();
            responseList.Count.Should().Be(1);
            responseList.ForEach(x => x.Success.Should().Be.True());

            var result = restAPIConnector.QueryFeaturesByWhereClause(string.Format("name='{0}'", testName));

            result.Should().Not.Be.Null();
            result.Count.Should().Be(1);
            result[0].Attributes.Name.Should().Be(testName);
            result[0].Attributes.Description.Should().Be(testName);
        }
		public void ShouldUpdateAnExistentFeatureInTheSampleFeatureServiceAtArcGISOnline()
		{
			List<RestAPIOperationResponseBase> responseList;
			var featuresList = CreateFeaturesList();
			var testName = featuresList[0].Attributes.Name;

			var restAPIConnector = new RestAPIFeatureServiceConnector<RestAPIFeature<Polygon, RestAPITestAttributeModel>, Polygon, RestAPITestAttributeModel>(TEST_FEATURE_URL);
			var sucessAdd = restAPIConnector.AddFeatures(featuresList, out responseList);
			sucessAdd.Should().Be.True();

			var result = restAPIConnector.QueryFeaturesByWhereClause(string.Format("name='{0}'", testName));
			result.Should().Not.Be.Null();
			result[0].Attributes.Name.Should().Be(testName);

			var newName = CreateFeatureName();
			result[0].Attributes.Name = newName;

			var sucessUpdate = restAPIConnector.UpdateFeatures(result, out responseList);
			sucessUpdate.Should().Be.True();

			var result2 = restAPIConnector.QueryFeaturesByWhereClause(string.Format("name='{0}'", newName));
			result2.Should().Not.Be.Null();
			result2[0].Attributes.Name.Should().Be(newName);
		}