예제 #1
0
        public void RDateTimeAttributeDisplayValueCorrect()
        {
            var result = new RDateTimeAttribute().Validate(() => new { Date = "Not a date" }, "Date", "Purchase date");

            Assert.IsNotNull(result);
            Assert.IsTrue(result.ErrorMessage.Contains("Purchase date"));
        }
예제 #2
0
        public void RDateTimeAttributeNegative()
        {
            var result = new RDateTimeAttribute().Validate(() => new { Date = "Not a date" }, "Date");

            Assert.IsNotNull(result);
        }
예제 #3
0
        public void RDateTimeAttributePositive()
        {
            var result = new RDateTimeAttribute().Validate(() => new { Date = DateTime.Now }, "Date");

            Assert.IsNull(result);
        }