Exemple #1
0
        public void EditNameTest_good()
        {
            UserTable ut = CreateUser(845, "orelie845");

            _userDataProxy.AddNewUser(ConvertToIUser(ut));
            _userDataProxy.EditName(845, "EditNameTest_good()_proxy");
            IUser user = _userDataProxy.GetUserById(845);

            Assert.AreEqual(user.Name(), "EditNameTest_good()_proxy");
            _userDataProxy.DeleteUserById(845);
        }
Exemple #2
0
        //use-case: user can edit is name
        public bool EditName(int userId, string newName)
        {
            bool  toReturn = false;
            IUser user     = _sc.GetUserWithId(userId);

            if (user == null)
            {
                return(toReturn);
            }
            toReturn = user.EditName(newName);
            if (toReturn)
            {
                _userDataProxy.EditName(userId, newName);
            }
            return(toReturn);
        }