Пример #1
0
        public void SaveUser(string userName, string password)
        {
            //Validate username
            try
            {
                isUserNameTaken(_registerRepozitory.GetListOfUserNames(), userName);
                isUserNameValid(userName);
                newUser.userName = userName;
            }
            catch (IncorrectUserDataException)
            {
                throw;
            }

            //Validate password
            try
            {
                isPasswordCorrect(password);
                newUser.password = HashPassword(password);
            }
            catch (IncorrectUserDataException)
            {
                throw;
            }
        }