예제 #1
0
        public void GeocodingAsyncInvalidClientCredentialsThrowsTest()
        {
            var _request = new GeocodingRequest {
                Address = "285 Bedford Ave, Brooklyn, NY 11211, USA", ClientId = "gme-ThisIsAUnitTest", SigningKey = "AAECAwQFBgcICQoLDA0ODxAREhM="
            };

            MapsTest.ThrowInnerException(() => GoogleMaps.Geocode.QueryAsync(_request).Wait());
        }
예제 #2
0
        public void GeocodingAsyncTimeoutTooShortThrowsTest()
        {
            var _request = new GeocodingRequest {
                Address = "285 Bedford Ave, Brooklyn, NY 11211, USA"
            };

            MapsTest.ThrowInnerException(() => GoogleMaps.Geocode.QueryAsync(_request, TimeSpan.FromMilliseconds(1)).Wait());
        }
예제 #3
0
        public void GeocodingAsyncCancelThrowsTest()
        {
            var _request = new GeocodingRequest {
                Address = "285 Bedford Ave, Brooklyn, NY 11211, USA"
            };

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

            _tokeSource.Cancel();
            MapsTest.ThrowInnerException(_task);
        }