Esempio n. 1
0
        public void RDateInRangeAttributeNegative()
        {
            var result = new RDateInRangeAttribute(2000, 1, 1, 2000, 12, 31)
                         .Validate(() => new { Date = DateTime.Now }, "Date");

            Assert.IsNotNull(result);
        }
Esempio n. 2
0
        public void RDateInRangeAttributeDisplayValueCorrect()
        {
            var result = new RDateInRangeAttribute(2000, 1, 1, 2000, 12, 31)
                         .Validate(() => new { Date = DateTime.Now }, "Date", "Purchase Date");

            Assert.IsNotNull(result);
            Assert.IsTrue(result.ErrorMessage.Contains("Purchase Date"));
        }