Esempio n. 1
0
        private async Task QueryCanGetBatchFeatures <T>(string rootUrl, string relativeUrl, bool returnGeometry)
            where T : IGeometry
        {
            var gateway = new PortalGateway(rootUrl);
            var query   = new Query(relativeUrl)
            {
                ReturnGeometry = returnGeometry
            };

            var result = await IntegrationTestFixture.TestPolicy.ExecuteAsync(() =>
            {
                return(gateway.BatchQuery <T>(query));
            });

            // Get total count of features to check that batch query returned everything
            var queryCount  = new QueryForCount(relativeUrl);
            var countResult = await gateway.QueryForCount(queryCount);

            Assert.NotNull(result);
            Assert.Null(result.Error);
            Assert.True(result.Features.Any());
            Assert.Null(result.Links);
            Assert.Equal(result.Features.Count(), countResult.NumberOfResults);
            if (returnGeometry)
            {
                Assert.NotNull(result.SpatialReference);
                Assert.True(result.Features.All(i => i.Geometry != null));
                Assert.Equal(typeof(T), result.GeometryType);
            }
        }