Beispiel #1
0
        public async Task CanGenerateToken()
        {
            var tokenProvider = new SecureTokenProvider(_serviceStackSerializer);
            var gateway       = new SecureGISGateway(_serviceStackSerializer);

            var endpoint = new ArcGISServerEndpoint("Oil/MapServer");

            var response = await gateway.Ping(endpoint);

            var token = await tokenProvider.CheckGenerateToken(CancellationToken.None);

            Assert.NotNull(token);
            Assert.NotNull(token.Value);
            Assert.False(token.IsExpired);
            Assert.Null(response.Error);

            gateway = new SecureGISGateway(new JsonDotNetSerializer());

            response = await gateway.Ping(endpoint);

            token = await tokenProvider.CheckGenerateToken(CancellationToken.None);

            Assert.NotNull(token);
            Assert.NotNull(token.Value);
            Assert.False(token.IsExpired);
            Assert.Null(response.Error);
        }
Beispiel #2
0
        public async Task CanDescribeSite()
        {
            var gateway = new SecureGISGateway(_serviceStackSerializer);

            var response = await gateway.DescribeSite();

            Assert.NotNull(response);
            Assert.True(response.Version > 0);

            foreach (var resource in response.ArcGISServerEndpoints)
            {
                var ping = await gateway.Ping(resource);

                Assert.Null(ping.Error);
            }
        }