Пример #1
0
        public void BirthValid()
        {
            var validator = new BirthInRangeValidator();
            var errors    = validator.Validate(new Person {
                Birth = new DateTime(2001, 09, 11)
            });

            Assert.AreEqual(0, errors.Count);
        }
Пример #2
0
        public void BirthYounger()
        {
            var validator = new BirthInRangeValidator();
            var errors    = validator.Validate(new Person {
                Birth = new DateTime(2018, 01, 01)
            });

            Assert.AreEqual(1, errors.Count);
            Assert.AreEqual("Birth not valid!", errors[0]);
        }