Exemplo n.º 1
0
        public void Register(string email, string password)
        {
            emailService = new EmailService();
            emailService.ValidateEmail(email);

            database = new Database();
            var user = new User(email, password);
            database.Save(user);

            SendWelcomeMessage(email);
        }
Exemplo n.º 2
0
        public void Register(string email, string password)
        {
            if (!email.Contains("@"))
            {
                throw new ValidationException("Email is not a valid email");
            }

            database = new Database();
            var user = new User(email, password);
            database.Save(user);

            smtpClient = new SmtpClient();
            smtpClient.Send(new MailMessage("*****@*****.**", email, "Hello fool !"));
        }
Exemplo n.º 3
0
 public void Save(User user)
 {
     userIsSaved = true;
 }