public void HierarchicalValidation_does_not_blow_up_with_missing_child() { var target = new HierarchicalValidationTarget { Name = "Me!" }; Validator.ValidateObject(target).GetChild("Child"); }
public void HierarchicalValidation() { var target = new HierarchicalValidationTarget { Name = "Me!", Child = new ValidatedTarget() }; Validator.ValidateObject(target).GetChild("Child").AllMessages .ShouldEqual( Validator.ValidateObject(target.Child).AllMessages); }