public void TestGetLastKnownLocation()
 {
     latch = new CountdownEvent(1);
     ACPPlaces.GetLastKnownLocation((location) =>
     {
         Assert.IsNotNull(location);
         latch.Signal();
         latch.Dispose();
     });
     latch.Wait();
 }
        public TaskCompletionSource <string> GetLastKnownLocation()
        {
            TaskCompletionSource <string> taskCompletionSource = new TaskCompletionSource <string>();
            Action <CLLocation>           action = (location) => {
                string coordinates = "Latitude: " + location.Coordinate.Latitude + " Logitutde: " + location.Coordinate.Longitude;
                taskCompletionSource.SetResult(coordinates);
            };

            ACPPlaces.GetLastKnownLocation(action);
            return(taskCompletionSource);
        }
        public void TestGetLastKnownLocation()
        {
            Location location = new Location("ACPPlacesTestApp.Xamarin");

            //Random coordinates
            location.Latitude  = 137.3309;
            location.Longitude = 11.8939;
            ACPPlaces.GetLastKnownLocation(new AdobeCallback());
            Location lastLocation = (Location)taskCompletionSource.Task.ConfigureAwait(false).GetAwaiter().GetResult();

            Assert.That(lastLocation, Is.Null);
        }
 public TaskCompletionSource <string> GetLastKnownLocation()
 {
     completionSource = new TaskCompletionSource <string>();
     ACPPlaces.GetLastKnownLocation(new AdobeCallBack(completionSource));
     return(completionSource);
 }