Пример #1
0
        public void CreateUser(string username, string password, string firstName, string lastName)
        {
            var user = new User(username, password, firstName, lastName);

            if (UserRepository.IsUserAvailable(username))
                throw new Exception("Account unavailable");

            if (!AuthenticationService.IsPasswordValid(user))
                throw new Exception("Account password is not valid");

            UserRepository.Save(user);
        }
Пример #2
0
 public void Save(User user)
 {
     throw new NotImplementedException();
 }
Пример #3
0
 public bool IsPasswordValid(User user)
 {
     return user.Password.Length > 5;
 }