public void ShouldFindSevenForLS73NU() { var service = new GooglePlacesService(); var closestGooglePlaceRequest = new ClosestGooglePlaceRequest { Command = new PostCodeSearchCommand { Postcode = "LS73NU" }, Types = new List<GooglePlaceType> { GooglePlaceType.food }}; var response = service.Execute(closestGooglePlaceRequest); Xunit.Assert.Equal("Seven", response.Name); Xunit.Assert.Equal((float)53.82792, response.Latitude); Xunit.Assert.Equal((float)-1.5374, response.Longitude); Xunit.Assert.Equal((float)0.3746797, response.Distance); }
public async Task <IEnumerable <Place> > GetPlacesByCategory(string category) { IPlacesService placesService = new GooglePlacesService(); var result = await Task.Factory.StartNew(() => placesService.FindNearestPlacesByCategory(category)); List <Place> places = new List <Place>(); foreach (var r in result) { places.Add(transformer.TransformAPINerabyPlaceToPlace(gp: r)); } return(places); }
public async void GetCarWashesAsync_ShouldReturnCarWashes () { var googlePlacesService = new GooglePlacesService (new System.Net.Http.HttpClient ()); var location = new GeoLocation { Latitude = 41.890969, Longitude = -87.676392 }; var resultTask = googlePlacesService.GetCarWashesAsync (location).Result; var places = resultTask as List<Place>; Assert.IsNotNull (places); }
public async void GetCarWashesAsync_ShouldReturnCarWashes() { var googlePlacesService = new GooglePlacesService(new System.Net.Http.HttpClient()); var location = new GeoLocation { Latitude = 41.890969, Longitude = -87.676392 }; var resultTask = googlePlacesService.GetCarWashesAsync(location).Result; var places = resultTask as List <Place>; Assert.IsNotNull(places); }
public void ShouldFindSevenForLS73NU() { var service = new GooglePlacesService(); var closestGooglePlaceRequest = new ClosestGooglePlaceRequest { Command = new PostCodeSearchCommand { Postcode = "LS73NU" }, Types = new List <GooglePlaceType> { GooglePlaceType.food } }; var response = service.Execute(closestGooglePlaceRequest); Xunit.Assert.Equal("Seven", response.Name); Xunit.Assert.Equal((float)53.82792, response.Latitude); Xunit.Assert.Equal((float)-1.5374, response.Longitude); Xunit.Assert.Equal((float)0.3746797, response.Distance); }