Ejemplo n.º 1
0
        public void SaveCurrentLocation()
        {
            #region Given state
            var user = SeedData.CreateAdmin(Context, "alexis");
            ILocationProvider locationProvider = new LocationProvider(Context, user);
            var currentLocation = locationProvider.SaveCurrentLocation(null, decimal.Round(32.834298M, 2), decimal.Round(-32.834298M, 2));
            #endregion

            #region Action state
            var locationId = currentLocation.Id;
            var getCurrentLocation = locationProvider.GetLocation(locationId);
            #endregion

            #region Result state
            getCurrentLocation.ShouldNotBeNull();
            getCurrentLocation.Longitude.ShouldEqual(decimal.Round(32.834298M, 2));
            getCurrentLocation.Latitude.ShouldEqual(decimal.Round(-32.834298M, 2));
            #endregion
        }
Ejemplo n.º 2
0
        public void SaveSuitPicture()
        {
            #region Given state
            var user = SeedData.CreateAdmin(Context, "dave");
            ILocationProvider cameraProvider = new LocationProvider(Context, user);
            var dummyPicture = new byte[] { 1, 2, 3, 4, 5 };
            var newPicture = cameraProvider.SavePicture(null, dummyPicture);
            #endregion

            #region Action state
            var newPictureId = newPicture.Id;
            var getPicture = cameraProvider.GetPicture(newPictureId);
            #endregion

            #region Result state
            getPicture.ShouldNotBeNull();
            getPicture.Id.ShouldEqual(1);
            #endregion
        }
Ejemplo n.º 3
0
 public LocationController()
 {
     Context = new DataContext();
     LocationProvider = new LocationProvider(Context, CurrentUser);
 }