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)); }
public void Setup() { _validator = new AnimalNameValidator(); _fixture = new Fixture(); }