예제 #1
0
        public async Task Error_is_returned_for_empty_request()
        {
            var geocodeRequest = new GeocodeRequest();

            var response = await googleGeocoder.GeocodeAddressAsync(geocodeRequest);

            Assert.Equal(GeocodeStatus.Error, response.ResponseStatus);
        }
        public async Task Bounds_are_preferred_over_viewport_when_both_are_present()
        {
            var geocodeRequest = new GeocodeRequest {
                Address = "File=Google/HasBoundsAndViewport.json"
            };

            var response = await googleGeocoder.GeocodeAddressAsync(geocodeRequest);

            var bounds = response.Locations.Single().Bounds;

            Assert.Equal(1.1, bounds.NorthEast.Latitude);
        }
예제 #3
0
        public async Task Trace_output_is_logged()
        {
            var geocodeRequest = new GeocodeRequest {
                Address = "Anywhere"
            };

            await googleGeocoder.GeocodeAddressAsync(geocodeRequest);

            Assert.Contains(logger.LoggedEventIds, l => l.Id == (int)LogEventIds.GeocoderResponse);
        }
예제 #4
0
        public async Task Exception_is_logged_for_null_request()
        {
            await googleGeocoder.GeocodeAddressAsync(null);

            Assert.Contains(logger.LoggedEventIds, l => l.Id == (int)LogEventIds.GeocodeException);
        }