Exemple #1
0
        public async Task DescribeProcess_ValidStringIdentifiersGiven_ShouldReturnTwoProcesses(string httpClientResponseXml)
        {
            var wpsClient = new WpsClient(new HttpClient(GetMockedMessageHandlerForResponse(httpClientResponseXml)), new XmlSerializationService());

            var collection = await wpsClient.DescribeProcess(MockUri, "i.gensigset", "i.gensig");

            collection.Should().HaveCount(2);
        }
Exemple #2
0
        public async Task DescribeProcess_InvalidSummariesGiven_ShouldThrowOwsException(string httpClientResponseXml)
        {
            var summaries = new[]
            {
                new ProcessSummary {
                    Identifier = "invalid 1"
                },
                new ProcessSummary {
                    Identifier = "invalid 2"
                }
            };

            var wpsClient = new WpsClient(new HttpClient(GetMockedMessageHandlerForResponse(httpClientResponseXml, HttpStatusCode.BadRequest)), new XmlSerializationService());

            await Assert.ThrowsAsync <OwsException>(() => wpsClient.DescribeProcess(MockUri, summaries));
        }
Exemple #3
0
        public async Task DescribeProcess_EmptyIdentifiersGiven_ShouldThrowArgumentNullException()
        {
            var wpsClient = new WpsClient(new HttpClient(), new XmlSerializationService());

            await Assert.ThrowsAsync <InvalidOperationException>(() => wpsClient.DescribeProcess(MockUri, new string[0]));
        }
Exemple #4
0
        public async Task DescribeProcess_NullUriGiven_ShouldThrowArgumentNullException()
        {
            var wpsClient = new WpsClient(new HttpClient(), new XmlSerializationService());

            await Assert.ThrowsAsync <ArgumentNullException>(() => wpsClient.DescribeProcess(null, string.Empty));
        }