public StudentIsConsistentValidation() { var studentIdentification = new StudentMustContainIdentificationSpecification(); var studentEmail = new StudentMustHaveEmailValidSpecification(); var studentBeOlder = new StudentMustBeOlderSpecification(); Add("studentIdentification", new Rule <Student>(studentIdentification, "A identificação do Estudante deve conter no mínimo 3 caracteres.")); Add("studentEmail", new Rule <Student>(studentEmail, "Estudante informou um e-mail inválido.")); Add("studentBeOlder", new Rule <Student>(studentBeOlder, "Estudante não tem maioridade para cadastro.")); }
public void Student_BeOlder_IsNotSatisfied() { // Arrange var student = new Student { BirthDate = new DateTime(2018, 01, 01) }; // Act var specificationReturn = new StudentMustBeOlderSpecification().IsSatisfiedBy(student); // Assert Assert.IsFalse(specificationReturn); }