コード例 #1
0
        public DataAnnotationValidatorFactoryFixture()
        {
            var factory =
                A.Fake<IPropertyValidatorFactory>();

            var adapter =
                A.Fake<IValidatableObjectAdapter>();

            this.subject = 
                new DataAnnotationsValidatorFactory(factory, adapter);
        }
コード例 #2
0
        public DataAnnotationValidatorFixture()
        {
            var adapterFactory = new DefaultPropertyValidatorFactory(new IDataAnnotationsValidatorAdapter[]
            {
                new RangeValidatorAdapter(),
                new RegexValidatorAdapter(),
                new RequiredValidatorAdapter(),
                new StringLengthValidatorAdapter(),
                new OopsAdapter()
            });

            var validator = A.Fake<IValidatableObjectAdapter>();

            this.factory = new DataAnnotationsValidatorFactory(adapterFactory, validator);
        }
コード例 #3
0
 public DataAnnotationValidatorFactoryFixture()
 {
     this.subject = new DataAnnotationsValidatorFactory();
 }