public User GetByEmail(string email)
 {
     AssertionConcern.AssertArgumentNotNull(email, ErrorMessages.InvalidEmail);
     email = email.ToLower().Trim();
     EmailAssertionConcern.AssertIsValid(email);
     return(_repository.GetByEmail(email));
 }
示例#2
0
        public void Validar()
        {
            AssertionConcern.AssertArgumentLength(this.Nome, 3, 100, "Nome de Usuário Inválido");

            EmailAssertionConcern.AssertIsValid(this.Email);
            PasswordAssertionConcern.AssertIsValid(this.Senha);
        }
示例#3
0
 public void Validar()
 {
     AssertionConcern.AssertArgumentNotNull(this.Nome, Errors.nomeUsuarioInvalido);
     AssertionConcern.AssertArgumentLength(this.Nome, 3, 50, Errors.nomeUsuarioInvalido);
     EmailAssertionConcern.AssertIsValid(this.Email);
     SenhaAssertionConcern.AssertIsValid(this.Senha);
 }
 public void Validate()
 {
     AssertionConcern.AssertArgumentNotNull(this.Nome, Errors.NomeEmBranco);
     AssertionConcern.AssertArgumentNotNull(this.Telefone, Errors.TelefoneEmBranco);
     AssertionConcern.AssertArgumentNotNull(this.Email, Errors.EmailEmBranco);
     EmailAssertionConcern.AssertIsValid(this.Email, Errors.EmailInvalido);
     TelefoneAssertionConcern.AssertIsValid(this.Telefone, Errors.TelefoneInvalido);
 }
示例#5
0
        public Email(string address)
        {
            AssertionConcern.AssertArgumentNotEmpty(address, Errors.EmailAddressRequired);
            AssertionConcern.AssertArgumentLength(address, AddressMaxLength, string.Format(Errors.EmailAddressMaxLength, AddressMaxLength));
            EmailAssertionConcern.AssertIsValid(address);

            Address = address;
        }
示例#6
0
        public void SetEmail(string email)
        {
            AssertionConcern.AssertArgumentNotEmpty(email, "Email is required");
            AssertionConcern.AssertArgumentLength(email, MinLength, MaxLength, string.Format("Email needs to be between {0} and {1} characters", MinLength, MaxLength));
            EmailAssertionConcern.AssertIsValid(email, "Email is invalid");

            Email = email;
        }
 /// <summary>
 /// Validar o Contato
 /// </summary>
 public void Validate()
 {
     AssertionConcern.AssertArgumentLength(this.Name, 3, 60, "Errors.InvalidContactName");
     AssertionConcern.AssertArgumentNotNull(this.Name, "");
     AssertionConcern.AssertArgumentLength(this.Telefone, 8, 12, "Errors.InvalidContactTelefone");
     AssertionConcern.AssertArgumentNotNull(this.Telefone, "");
     EmailAssertionConcern.AssertIsValid(this.Email);
     PasswordAssertionConcern.AssertIsValid(this.Password);
 }
示例#8
0
 public void Validate()
 {
     AssertionConcern.AssertArgumentLength(this.Address, 3, 500, "Endereço deve ter entre 3 e 500 caracteres.");
     AssertionConcern.AssertArgumentLength(this.Name, 3, 100, "Nome deve ter entre 3 e 100 caracteres.");
     AssertionConcern.AssertArgumentLength(this.Email, 3, 100, "E-mail deve ter entre 3 e 100 caracteres.");
     EmailAssertionConcern.AssertIsValid(this.Email);
     AssertionConcern.AssertArgumentZero(this.MaritalStatus, "Estado civil deve ser informado.");
     AssertionConcern.AssertArgumentNotNull(this.MaritalStatus, "Estado civil deve ser informado.");
     //AssertionConcern.AssertArgumentNotNull(this.Phones, "Telefone deve ser informado.");
 }
示例#9
0
        public void Validate(int id, string eletronicEmail)
        {
            if (id > 0)
            {
                Id = id;
            }

            if (EmailAssertionConcern.AssertIsInvalid(eletronicEmail, Errors.EmailInvalid))
            {
                ElectronicMail = eletronicEmail;
            }
        }
        public static void IsValid(this ClientViewModel client)
        {
            var requiredMessage = "Campo obrigatório.";

            AssertionConcern.AssertArgumentNotNull(client.Name, requiredMessage);
            AssertionConcern.AssertArgumentNotNull(client.PhoneNumber, requiredMessage);
            AssertionConcern.AssertArgumentNotNull(client.Email, requiredMessage);
            EmailAssertionConcern.AssertIsValid(client.Email, "E-mail inválido");
            AssertionConcern.AssertArgumentNotEmpty(client.DocumentNumber, requiredMessage);
            AssertionConcern.AssertArgumentNotEmpty(client.Name, requiredMessage);
            AssertionConcern.AssertArgumentNotEmpty(client.PhoneNumber, requiredMessage);
            AssertionConcern.AssertArgumentNotEmpty(client.Email, requiredMessage);
            AssertionConcern.AssertArgumentNotEmpty(client.DocumentNumber, requiredMessage);
        }
示例#11
0
 public void Should_ThrowsInvalidEmail_WhenIsText()
 {
     EmailAssertionConcern.AssertEmailFormat("tries email validation with text", "error message");
 }
示例#12
0
 public void Should_ThrowsInvalidEmail()
 {
     EmailAssertionConcern.AssertEmailFormat("your_email@domain", "error message");
 }
示例#13
0
 public void Should_AssertEmailFormat()
 {
     Assert.DoesNotThrow(() => EmailAssertionConcern.AssertEmailFormat("*****@*****.**", "error message"));
 }
示例#14
0
 //Valida se o objeto instanciado está correto
 public void Valid()
 {
     AssertionConcern.AssertArgumentLength(this.Name, 3, 250, "Nome inválido");
     EmailAssertionConcern.Email(this.Email);
 }
示例#15
0
 public static void emailUsuarioEhValido(this Usuario usuario)
 {
     EmailAssertionConcern.AssertIsValid(usuario.Email);
 }
示例#16
0
 public void Validate()
 {
     PasswordAssertionConcern.AssertIsValid(this.Password);
     AssertionConcern.AssertArgumentLength(this.Name, 4, 50, Errors.InputOutOfRange);
     EmailAssertionConcern.AssertIsValid(this.Email);
 }
示例#17
0
 public void Validate()
 {
     AssertionConcern.AssertArgumentLength(this.Name, 3, 250, Errors.InvalidUserName);
     EmailAssertionConcern.AssertIsValid(this.Email);
     PasswordAssertionConcern.AssertIsValid(this.Password);
 }
示例#18
0
 public void ValidateAutentication()
 {
     EmailAssertionConcern.AssertIsValid(this.Email);
     PasswordAssertionConcern.AssertIsValid(this.Password);
     this.Password = PasswordAssertionConcern.Encrypt(this.Password);
 }