Ejemplo n.º 1
0
        [InlineData(1754, 1, 1, true)]    // > 1753
        public void IsSatisfiedBy(int year, int month, int day, bool expected)
        {
            var  date          = new DateTime(year, month, day);
            var  specification = new SqlDateSpecification();
            bool actual        = specification.IsSatisfiedBy(date);

            Assert.Equal(expected, actual);
        }
Ejemplo n.º 2
0
        protected override bool IsValid(PropertyValidatorContext context)
        {
            var date = this.GetDateTime(context.PropertyValue);

            if (!date.HasValue)
            {
                return(true);
            }

            var specification = new SqlDateSpecification();

            return(specification.IsSatisfiedBy(date.Value));
        }