예제 #1
0
        public void IsValidReturnsExpectedValueTest(int minYear, object value, bool allowNull, bool expected)
        {
            var sut = new ValidPastYearAttribute(minYear, allowNull);

            var actual = sut.IsValid(value);

            actual.Should().Be(expected);
        }
예제 #2
0
        public void IsValidReturnsTrueForCurrentYearTest()
        {
            var year = DateTimeOffset.UtcNow.Year;

            var sut = new ValidPastYearAttribute(year);

            var actual = sut.IsValid(year);

            actual.Should().BeTrue();
        }