Exemplo n.º 1
0
        public void ShouldValidateDateIsInTheFuture(bool expectedIsValid, int secondsToAdd)
        {
            var dateTimeNow = new DateTime(2020, 1, 28);

            var attribute = new DateInFuture(() => dateTimeNow);

            var isValid = attribute.IsValid(dateTimeNow.AddSeconds(secondsToAdd));

            Assert.Equal(expectedIsValid, isValid);
        }
Exemplo n.º 2
0
        public void ShouldHaveExpectedErrorMessage()
        {
            var attribute = new DateInFuture();

            Assert.Equal("Date must be in the future", attribute.ErrorMessage);
        }