public async void CheckThatTheApiClientCorrectlySerialisesAMapBoxReversGeoCodingResponse() { var key = Guid.NewGuid().ToString(); var request = new MapBoxReverseGeocodingRequest(key) { Latitude = 0, Longitude = 0 }; var apiResponse = await GetResponse(new ApiClient(), request, GetReversGeoCodingMapBoxResponseResult()); Assert.That(request.Path, Is.StringContaining($"access_token={key}")); Assert.That(apiResponse, Is.Not.Null); Assert.That(apiResponse.Features.Count, Is.EqualTo(5)); Assert.That(apiResponse.Features[0].Id, Is.EqualTo("address.5703004565802462")); }
public async void CheckThatTheReverseGeoCodingRequestReturnsValidResults() { var client = Substitute.For <IApiClient>(); var provider = new MappingDataProvider(client); var request = new MapBoxReverseGeocodingRequest { Latitude = 51.4500, Longitude = -2.5833 }; var response = new MapBoxGeocodingResponse(); client.GetAsync(request).Returns(info => response); var apiResponse = await provider.GetAsync(request); Assert.That(apiResponse, Is.SameAs(response)); }