public InstructorIsConsistentValidation() { var instructorIdentification = new InstructorMustContainIdentificationSpecification(); var instructorEmail = new InstructorMustHaveEmailValidSpecification(); var instructorBeOlder = new InstructorMustBeOlderSpecification(); Add("instructorIdentification", new Rule <Instructor>(instructorIdentification, "A identificação do Instrutor deve conter no mínimo 3 caracteres.")); Add("instructorEmail", new Rule <Instructor>(instructorEmail, "Instrutor informou um e-mail inválido.")); Add("instructorBeOlder", new Rule <Instructor>(instructorBeOlder, "Instrutor não tem maioridade para cadastro.")); }
public void Instructor_EmailSpecification_IsNotSatisfied() { // Arrange var instructor = new Instructor { Email = "josemartins#hotmail.com" }; // Act var specificationReturn = new InstructorMustHaveEmailValidSpecification().IsSatisfiedBy(instructor); // Assert Assert.IsFalse(specificationReturn); }