public void SetUp()
 {
     var registry = new ValidationRegistry();
     var resolver = new TypeResolver();
     _query = new ValidationQuery(resolver, registry.GetConfiguredSources());
     _provider = new ValidationProvider(resolver, _query);
 }
Exemplo n.º 2
0
 public void Configure(ValidationRegistry registry)
 {
     registry
         .Rules
         .For<UserInputModel>()
         .Require(u => u.Password)
         .Require(u => u.ConfirmPassword)
         .Compare(u => u.Password, u => u.ConfirmPassword);
 }
        public void SetUp()
        {
            var validationRegistry = new ValidationRegistry(registry =>
                                                                {
                                                                    registry
                                                                        .Rules
                                                                        .IfPropertyIs<int>()
                                                                        .ApplyStrategy<GreaterThanZeroFieldStrategy>();

                                                                    registry
                                                                        .Rules
                                                                        .If(a => a.Name.ToLower().Contains("required"))
                                                                        .ApplyStrategy<RequiredFieldStrategy>();
                                                                });
            var resolver = new TypeResolver();
            _query = new ValidationQuery(resolver, validationRegistry.GetConfiguredSources());
            _provider = new ValidationProvider(resolver, _query);
        }
 public void SetUp()
 {
     theRegistry = new ValidationRegistry();
 }