Example #1
0
        public static List <string> Validate(Animal model, List <Animal> existingAnimals)
        {
            DuplicatesValidator duplicatesValidator = new DuplicatesValidator(existingAnimals);
            AnimalNameValidator animalNameValidator = new AnimalNameValidator();

            duplicatesValidator.SetSuccessor(animalNameValidator);
            YearOfBirthValidator yearOfBirthValidator = new YearOfBirthValidator();

            animalNameValidator.SetSuccessor(yearOfBirthValidator);

            return(duplicatesValidator.HandleValidation(model));
        }
Example #2
0
 public void Setup()
 {
     _validator = new AnimalNameValidator();
     _fixture   = new Fixture();
 }