public void TestGetNearbyPointOfInterests() { Location location = new Location("ACPPlacesTestApp.Xamarin"); location.Latitude = 37.3309; location.Longitude = 121.8939; ACPPlaces.GetNearbyPointsOfInterest(location, 0, new AdobeCallback()); AbstractList pois = (AbstractList)taskCompletionSource.Task.ConfigureAwait(false).GetAwaiter().GetResult(); Assert.That(pois.Size, Is.EqualTo(0)); }
public void TestGetNearbyPointOfInterests() { latch = new CountdownEvent(1); ACPPlaces.GetNearbyPointsOfInterest(new CLLocation(37.3309, 121.8939), 0, (pois) => { Assert.That(pois.Count, Is.EqualTo(0)); latch.Signal(); latch.Dispose(); }); latch.Wait(1000); }
public TaskCompletionSource <string> GetNearbyPointOfInterests() { Location location = new Location("ACPPlacesTestApp.Xamarin"); //San Jose down town coordinates. location.Latitude = 37.3309; location.Longitude = -121.8939; completionSource = new TaskCompletionSource <string>(); ACPPlaces.GetNearbyPointsOfInterest(location, 10, new AdobeCallBack(completionSource)); return(completionSource); }
public TaskCompletionSource <string> GetNearbyPointOfInterests() { TaskCompletionSource <string> taskCompletionSource = new TaskCompletionSource <string>(); Action <NSArray <ACPPlacesPoi> > action = (pois) => { string poiNames = ""; foreach (ACPPlacesPoi poi in pois) { poiNames += (poi.Name + ","); } taskCompletionSource.SetResult(poiNames.EndsWith(",") ? poiNames.Substring(0, poiNames.Length - 1) : "None"); }; ACPPlaces.GetNearbyPointsOfInterest(new CLLocation(37.3309, -121.8939), 10, action); //Coordinates of San Jose Downtown. return(taskCompletionSource); }