public void TestGetCurrentPointOfInterests() { latch = new CountdownEvent(1); ACPPlaces.GetCurrentPointsOfInterest((pois) => { Assert.That(pois.Count, Is.EqualTo(0)); latch.Signal(); latch.Dispose(); }); latch.Wait(1000); }
public void TestGetCurrentPointOfInterests() { Location location = new Location("ACPPlacesTestApp.Xamarin"); //Random coordinates location.Latitude = 137.3309; location.Longitude = 11.8939; ACPPlaces.GetCurrentPointsOfInterest(new AdobeCallback()); AbstractList pois = (AbstractList)taskCompletionSource.Task.ConfigureAwait(false).GetAwaiter().GetResult(); Assert.That(pois.Size, Is.EqualTo(0)); }
public TaskCompletionSource <string> GetCurrentPointsOfInterests() { 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.GetCurrentPointsOfInterest(action); return(taskCompletionSource); }
public TaskCompletionSource <string> GetCurrentPointsOfInterests() { completionSource = new TaskCompletionSource <string>(); ACPPlaces.GetCurrentPointsOfInterest(new AdobeCallBack(completionSource)); return(completionSource); }