public void IsValidShouldWorkCorrectly(int afterYear, int year, bool expected) { // Arrange var attribute = new BeforeCurrentYearAttribute(afterYear); // Act var result = attribute.IsValid(year); // Assert Assert.Equal(expected, result); }
public void IsValidWithCurrentYearShouldReturnTrue() { // Arrange const int afterYear = 1900; var attribute = new BeforeCurrentYearAttribute(afterYear); // Act var result = attribute.IsValid(DateTime.UtcNow.Year); // Assert Assert.True(result); }