예제 #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;
 }