public void EditPasswordTest() { UserTable ut = CreateUser(858580000, "EditPasswordTest()-proxy"); _userDataProxy.AddNewUser(ConvertToIUser(ut)); _userDataProxy.EditPassword(858580000, "EditPasswordTest"); IUser user = _userDataProxy.GetUserById(858580000); Assert.AreEqual(user.Password(), "EditPasswordTest"); _userDataProxy.DeleteUserById(858580000); }
//use-case: user can edit is password public bool EditUserPassword(int userId, string newPassword) { bool toReturn = false; IUser user = _sc.GetUserWithId(userId); if (user == null) { return(toReturn); } toReturn = user.EditPassword(newPassword); if (toReturn) { _userDataProxy.EditPassword(userId, newPassword); } return(toReturn); }