コード例 #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.Equal(expectedIsValid, isValid);
        }
コード例 #2
0
        public void ShouldHaveExpectedErrorMessage()
        {
            var attribute = new DateWithoutTimeAttribute();

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