private InlineValidator <ApplicationViewModel> GetRules() { var validator = new InlineValidator <ApplicationViewModel>(); validator.Include(new ApplicationIsRequired().GetRules()); validator.Include(new UrlIsRequired().GetRules()); validator.Include(new UrlFormat().GetRules()); validator.Include(new PathLocalIsRequired().GetRules()); return(validator); }
public void Ruleset_selection_should_cascade_downwards_with_when_setting_child_validator_using_include_statement_with_lambda() { var validator = new InlineValidator <Person>(); validator.Include(x => new TestValidator2()); var result = validator.Validate(new Person(), ruleSet: "Names"); result.IsValid.ShouldBeFalse(); }