public void EditUserIdTest_good() { UserTable ut = CreateUser(35667, "orelieS"); _userDataProxy.AddNewUser(ConvertToIUser(ut)); _userDataProxy.EditUserId(35667, 951); IUser user = _userDataProxy.GetUserById(951); Assert.AreEqual(user.Id(), 951); _userDataProxy.DeleteUserById(951); }
//use-case: user can edit is Id public bool EditId(int userId, int newId) { bool toReturn = false; IUser user = _sc.GetUserWithId(userId); if (user == null || !_sc.IsIdFree(newId)) { return(toReturn); } toReturn = user.EditId(newId); if (toReturn) { _userDataProxy.EditUserId(userId, newId); } return(toReturn); }