public void SuccessValidate() { var person = new Person() { Name = "Oi", Age = 10, Address = new Address() { Name = "Oi" } }; _validator = new ValidateWithAttributesCommand(); _validator.Execute(person); }
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))); }
private ValidationException Execute(Person person) { _validator = new ValidateWithJSONCommand(_validators.ToList()); return(Assert.Throws <ValidationException>(() => _validator.Execute(person))); }