Exemple #1
0
        public bool LocationExists(Location newLocation)
        {
            if (_locationDB.GetLocation(newLocation) != null)
            {
                return(true);
            }

            return(false);
        }
        public void GetLocationSuccess()
        {
            int      id       = LocationDB.GetLocations(active)[0].Id;
            Location location = LocationDB.GetLocation(id);

            Assert.IsNotNull(location);
        }
        public void DeleteLocationSuccess()
        {
            int id = LocationDB.GetLocations(active)[0].Id;

            LocationDB.DeleteLocation(id);
            Assert.AreEqual(LocationDB.GetLocation(id).Active, false);
        }
Exemple #4
0
        public void GetLocationReturnsNull()
        {
            using (var context = new Entity.p0storeContext(options)){
                LocationDB _locationDB = new LocationDB(context);
                var        location    = _locationDB.GetLocation(new Model.Location("non existing store", "123 doesnt exist"));

                Assert.Null(location);
            }
        }
        public void GetLocationFailed()
        {
            int      id       = 100;
            Location location = LocationDB.GetLocation(id);

            Assert.IsNull(location);

            //Assert.IsNull(LocationDB.GetLocation(id));
        }
Exemple #6
0
        public void GetLocationReturnsLocation()
        {
            using (var context = new Entity.p0storeContext(options)){
                LocationDB _locationDB = new LocationDB(context);
                var        location    = _locationDB.GetLocation(new Model.Location("cool store", "123 cool st Baltimore MD"));
                int        locationID  = location.LocationID;

                Assert.Equal(1, locationID);
            }
        }
Exemple #7
0
        protected override void OnHandleIntent(Intent intent)
        {
            var gEvent = GeofencingEvent.FromIntent(intent);

            if (gEvent.GeofenceTransition == Geofence.GeofenceTransitionEnter)
            {
                foreach (var geofence in gEvent.TriggeringGeofences)
                {
                    var location = LocationDB.GetLocation(int.Parse(geofence.RequestId));
                    if (location.Active)
                    {
                        CrossLocalNotifications.Current.Show(location.Title, location.Description);
                        CrossVibrate.Current.Vibration();
                    }
                }
            }
        }
        public void UpdateLocationSuccess()
        {
            int      id       = LocationDB.GetLocations(active)[0].Id;
            Location location = new Location
            {
                Longitude = 32.43543m,
                Latitude  = 14.32456m,
                Active    = true
            };
            Location localLocation = LocationDB.GetLocation(id);

            location.Longitude = localLocation.Longitude;
            location.Latitude  = localLocation.Latitude;

            LocationDB.UpdateLocation(location, id);
            Location updatedLocation = LocationDB.GetLocation(id);

            Assert.AreEqual(updatedLocation.Longitude, location.Longitude);
        }
Exemple #9
0
 public Location GetLocation(int id)
 {
     return(LocationDB.GetLocation(id));
 }