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); }
public void IsValidReturnsTrueForCurrentYearTest() { var year = DateTimeOffset.UtcNow.Year; var sut = new ValidPastYearAttribute(year); var actual = sut.IsValid(year); actual.Should().BeTrue(); }