Exemplo n.º 1
0
        public static void SetupRepositories(
            ValidatorRepository validatorRepository, 
            MapperRepository mapperRepository, 
            IReadOnlyCollection<Type> types)
        {
            Reflection.GetAllValidators(types).ToList()
                .ForEach(p => validatorRepository.AddValidator(p.Key, p.Value));

            Reflection.GetAllValidationConstraintMappers(types).ToList()
                .ForEach(p => mapperRepository.AddMapper(p.Key, p.Value));
        }
Exemplo n.º 2
0
 public void Setup()
 {
     _validatorRepo = new ValidatorRepository();
     _validatorRepo.AddValidator(typeof(CommandA), typeof(TestValidator<CommandA>));
     _validatorRepo.AddValidator(typeof(QueryA), typeof(TestValidator<CommandB>));
 }