示例#1
0
 public static bool ChangeCPFScopeIsValid(this Person person, string cpf)
 {
     return(AssertionConcern.IsSatisfiedBy(
                CPFAssertionConcern.AssertIsValid(cpf, Errors.InvalidCPF),
                AssertionConcern.AssertArgumentNotNull(cpf, Errors.InvalidCPF),
                AssertionConcern.AssertArgumentLength(cpf, 11, 11, Errors.InvalidCPF)
                ));
 }
示例#2
0
 public static bool CreatePersonScopeIsValid(this Person person)
 {
     return(AssertionConcern.IsSatisfiedBy(
                AssertionConcern.AssertArgumentNotNull(person.Name, Errors.InvalidName),
                AssertionConcern.AssertArgumentLength(person.Name, 4, 65, Errors.InvalidName),
                CPFAssertionConcern.AssertIsValid(person.CPF, Errors.InvalidCPF),
                AssertionConcern.AssertArgumentNotNull(person.CPF, Errors.InvalidCPF),
                AssertionConcern.AssertArgumentLength(person.CPF, 11, 11, Errors.InvalidCPF),
                AssertionConcern.AssertArgumentNotNull(person.BirthDate, Errors.InvalidBirthDate),
                AssertionConcern.AssertArgumentIsGreaterThan(DateTime.Now, person.BirthDate, Errors.InvalidBirthDate),
                AssertionConcern.AssertArgumentNotNull(person.Genre, Errors.InvalidGenre)
                ));
 }