public EventController(SeatGeekClient seatGeekClient, YelpClient yelpClient, UserManager <IdentityUser> userManager, PlanFortDBContext planFortDBContext)//<< using dependency injection { _seatGeekClient = seatGeekClient; _yelpClient = yelpClient; _userManager = userManager; _planFortDBContext = planFortDBContext; }
public void YelpClient_investigation() { // Arrange // Act var client = new YelpClient(); var x = client.GetAllJson("the-residence-wellington-2"); // Assert }
//[Test] public void TestYelpService_ReturnEvents() { var service = new YelpClient(); var events = service.GetEventData("Settle"); Assert.IsNotNull(events); Assert.IsTrue(events.Count() > 5, "Events from Yelp.com should be more than 0"); foreach (var e in events) { AssertEventPopulated(e); } }
private async void OnSearch(object obj) { IsSearching = true; using (var dialog = UserDialogs.Instance.Loading("Searching...")) { var yelpClient = new YelpClient(App.Config.Yelp.AccessToken, App.Config.Yelp.AccessTokenSecret, App.Config.Yelp.ConsumerKey, App.Config.Yelp.ConsumerSecret); var yelpGeneralOptions = new YelpSearchOptionsGeneral(query: SearchText, radiusFilter: 25000); var yelpLocationOptions = new YelpSearchOptionsLocation(City.Name); var yelpSearchOptions = new YelpSearchOptions(general: yelpGeneralOptions, location: yelpLocationOptions); var yelpResults = await yelpClient.SearchWithOptions(yelpSearchOptions); ClearSearchResults(); var currentPois = new HashSet <String>(City.Places .Select(X => X.Address) .Distinct()); foreach (var business in yelpResults.businesses) { if (business?.location?.coordinate == null) { continue; // Ignore businesses without a location. } var result = new SearchResult { Name = business.name, Latitude = business.location.coordinate.Latitude, Longitude = business.location.coordinate.Longitude, Address = String.Join(", ", business.location.display_address), YelpData = business }; if (currentPois.Contains(result.Address)) { continue; } SearchResults.Add(result); } var positions = SearchResults .Select(X => new Position(X.Latitude, X.Longitude)) .ToArray(); RaiseChanged(); RequestMapNavigationExtent(this, positions); } }
// GET: api/BugFix public void Get() { YelpClient x = new YelpClient(); x.GetAllJson("the-residence-wellington-2"); }
public EventController(SeatGeekClient seatGeekClient, YelpClient yelpClient)//<< using dependency injection { _seatGeekClient = seatGeekClient; _yelpClient = yelpClient; }