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 }
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 }
public LocationController() { Context = new DataContext(); LocationProvider = new LocationProvider(Context, CurrentUser); }