Exemple #1
0
        public void ShouldReturnResourcesIds()
        {
            CkanClient client = CkanApiHelper.GetCkanClient();

            var parameters = new ResourceSearchParameters();

            parameters.Description = "city";

            var response = client.SearchResources <string>(parameters);

            Assert.NotEmpty(response.Results);
        }
Exemple #2
0
        public void ShouldReturnResourcesWithLimitAndOffset()
        {
            CkanClient client = CkanApiHelper.GetCkanClient();

            var parameters = new ResourceSearchParameters();

            parameters.Limit       = 1;
            parameters.Offset      = 1;
            parameters.Description = "city";

            var response = client.SearchResources <Resource>(parameters);

            Assert.True(response.Results.Count == 1);
        }
Exemple #3
0
        public void ShouldReturnResourcesByDescription()
        {
            CkanClient client = CkanApiHelper.GetCkanClient();

            var parameters = new ResourceSearchParameters();

            parameters.Description = "city";

            var response = client.SearchResources <Resource>(parameters);

            Assert.NotEmpty(response.Results);

            Assert.Contains("city", response.Results[0].Description, StringComparison.InvariantCultureIgnoreCase);
        }
Exemple #4
0
        public void ShouldReturnResourcesByFormat()
        {
            CkanClient client = CkanApiHelper.GetCkanClient();

            var parameters = new ResourceSearchParameters();

            parameters.Format = "kml";

            var response = client.SearchResources <Resource>(parameters);

            Assert.NotEmpty(response.Results);

            foreach (var result in response.Results)
            {
                Assert.Contains("kml", result.Format, StringComparison.InvariantCultureIgnoreCase);
            }
        }