public void SuccessValidate()
        {
            var person = new Person()
            {
                Name = "Oi", Age = 10, Address = new Address()
                {
                    Name = "Oi"
                }
            };

            _validator = new ValidateWithAttributesCommand();

            _validator.Execute(person);
        }
Пример #2
0
        public void SuccessValidate()
        {
            var person = new Person()
            {
                Name = "Oi", Age = 10, Address = new Address()
                {
                    Name = "Oi"
                }
            };

            _validator = new ValidateWithJSONCommand(_validators.ToList());

            _validator.Execute(person);
        }
        public ActionResult Post(Person person)
        {
            _validator.Execute(person);

            return(Ok(person));
        }
        private ValidationException Execute(Person person)
        {
            _validator = new ValidateWithAttributesCommand();

            return(Assert.Throws <ValidationException>(() => _validator.Execute(person)));
        }
Пример #5
0
        private ValidationException Execute(Person person)
        {
            _validator = new ValidateWithJSONCommand(_validators.ToList());

            return(Assert.Throws <ValidationException>(() => _validator.Execute(person)));
        }