Ejemplo n.º 1
0
        public void GeocodingWhenTimeoutTest()
        {
            var _request = new GeocodingRequest {
                Address = "285 Bedford Ave, Brooklyn, NY 11211, USA"
            };

            Assert.Throws <TimeoutException>(() => MapsTest.ThrowInnerException(() => GoogleMaps.Geocode.Query(_request, TimeSpan.FromMilliseconds(1))));
        }
Ejemplo n.º 2
0
        public void GeocodingWhenInvalidClientCredentialsTest()
        {
            var _request = new GeocodingRequest {
                Address = "285 Bedford Ave, Brooklyn, NY 11211, USA", ClientId = "gme-ThisIsAUnitTest", Key = "AAECAwQFBgcICQoLDA0ODxAREhM="
            };

            Assert.Throws <AuthenticationException>(() => MapsTest.ThrowInnerException(() => GoogleMaps.Geocode.Query(_request)));
        }
Ejemplo n.º 3
0
        public void GeocodingAsyncCancelThrowsTest()
        {
            var _request = new GeocodingRequest {
                Address = "285 Bedford Ave, Brooklyn, NY 11211, USA"
            };

            var _cancellationTokenSource = new CancellationTokenSource();
            var _task = GoogleMaps.Geocode.QueryAsync(_request, _cancellationTokenSource.Token);

            _cancellationTokenSource.Cancel();

            Assert.Throws <TaskCanceledException>(() => MapsTest.ThrowInnerException(_task));
        }