public void 驗證Sons_IEnumerable()
        {
            var father = new Father
            {
                Age = 90,
                Name = "Fat",
                Sons = Enumerable.Repeat<Son>(new Son { Name = "91", Age = 300 }, 2)
            };

            var validator = new DataAnnotationValidator();

            var isValid = validator.TryValidate(father);

            Assert.AreEqual(false, isValid);

            Assert.AreEqual(2, validator.ValidationResults.Count);
        }
        public void 驗證List集合是否能正常驗證Validation()
        {
            var father = new Father
            {
                Name = "Joey",
                Age = 999,
                Sons = new List<Son>
                {
                    new Son{Age=0},
                    new Son{Name=string.Empty, Age=200},
                    new Son{Name="91", Age=300},
                }
            };

            var validator = new DataAnnotationValidator();

            var isValid = validator.TryValidate(father);

            Assert.AreEqual(false, isValid);

            Assert.AreEqual(6, validator.ValidationResults.Count);
        }