public void UpdateLocationTest() { try { DbLocation dbLocation = new DbLocation(); Location location = new Location { User = new User { UserId = 1 }, Latitude = 1, Longitude = 1, LocationDescription = "Test description", LocationName = "UpdateTest1" }; Location newLocation = location; newLocation.LocationDescription = "Test description"; newLocation.LocationName = "UpdateTest2"; int id = dbLocation.Create(location); location.LocationId = id; newLocation.LocationId = id; dbLocation.UserUpdateLocation(newLocation); string foundLocationName = dbLocation.FindById(id).LocationName; Assert.IsTrue(foundLocationName.Equals("UpdateTest2")); dbLocation.Delete(id); } catch (FaultException <System.Exception> ) { Assert.Fail(); } }
/// <summary> /// updates a location based on user input /// </summary> /// <param name="location"></param> public void UserUpdateLocation(Location location) { _dbLocation.UserUpdateLocation(location); }