예제 #1
0
        public void ShouldReturnDateMustBeInTheFuture(bool expectedIsValid, int hour, int minute, int second)
        {
            var dateTime = new DateTime(2020, 1, 28, hour, minute, second);

            var attribute = new DateWithoutTimeAttribute();

            var isValid = attribute.IsValid(dateTime);

            Assert.AreEqual(expectedIsValid, isValid);
        }
예제 #2
0
        public void ShouldHaveExpectedErrorMessage()
        {
            var attribute = new DateWithoutTimeAttribute();

            Assert.AreEqual("Date must not contain time", attribute.ErrorMessage);
        }