Exemplo n.º 1
0
        private static void TestTripLegUpdate(ResourceVerification verification, string httpMethod, string preferHeader, bool useBatch, DSPMetadata roadTripMetadata)
        {
            var tripLeg = SpatialTestUtil.CreateTripLegResource(
                roadTripMetadata,
                verification.Id,
                verification.PropertyValues.TripLegGeography1,
                verification.PropertyValues.TripLegGeography2,
                useComplexType: false,
                modifyPropertyValues: null);

            ExecuteUpdate(tripLeg, verification.Id, verification.Request, httpMethod, preferHeader, useBatch, verification.PayloadFormat);

            // Verify that the operation was successful by querying the same data again
            verification.GetAndVerifyTripLeg();
        }
Exemplo n.º 2
0
        public void SerializeGeodeticPropertiesInResource()
        {
            var testCases = new[]
            {
                new
                {
                    GeographyType = typeof(GeographyPoint),
                    DefaultValues = TestPoint.DefaultValues
                },
                new
                {
                    GeographyType = typeof(GeographyLineString),
                    DefaultValues = TestLineString.DefaultValues
                },
            };

            var responseFromats = new string[] { UnitTestsUtil.AtomFormat };

            TestUtil.RunCombinations(testCases, responseFromats, (testCase, responseFormat) =>
            {
                GeographyPropertyValues defaultValues = testCase.DefaultValues;

                DSPUnitTestServiceDefinition roadTripServiceDefinition = GetRoadTripServiceDefinition(testCase.GeographyType, defaultValues);
                using (TestWebRequest request = roadTripServiceDefinition.CreateForInProcess())
                {
                    request.StartService();
                    request.Accept = responseFormat;

                    ResourceVerification verification = GetResourceVerification(responseFormat, SpatialTestUtil.DefaultId, defaultValues, request);

                    // Geography property followed by another geography property
                    verification.GetAndVerifyTripLeg();

                    // Geography property followed by another non-geography property
                    verification.GetAndVerifyAmusementPark();

                    // Geography property at the end of the entry
                    verification.GetAndVerifyRestStop();
                }
            });
        }
Exemplo n.º 3
0
        private static void TestTripLegUpdate(ResourceVerification verification, string httpMethod, string preferHeader, bool useBatch, DSPMetadata roadTripMetadata)
        {
            var tripLeg = SpatialTestUtil.CreateTripLegResource(
                roadTripMetadata,
                verification.Id,
                verification.PropertyValues.TripLegGeography1,
                verification.PropertyValues.TripLegGeography2,
                useComplexType: false,
                modifyPropertyValues: null);

            ExecuteUpdate(tripLeg, verification.Id, verification.Request, httpMethod, preferHeader, useBatch, verification.PayloadFormat);

            // Verify that the operation was successful by querying the same data again
            verification.GetAndVerifyTripLeg();
        }