예제 #1
0
        public void HierarchicalValidation_does_not_blow_up_with_missing_child()
        {
            var target = new HierarchicalValidationTarget
                             {
                                 Name = "Me!"
                             };

            Validator.ValidateObject(target).GetChild("Child");
        }
예제 #2
0
        public void HierarchicalValidation()
        {
            var target = new HierarchicalValidationTarget
                             {
                                 Name = "Me!",
                                 Child = new ValidatedTarget()
                             };

            Validator.ValidateObject(target).GetChild("Child").AllMessages
                .ShouldEqual(
                Validator.ValidateObject(target.Child).AllMessages);
        }