public void IsValidReturnsFalseForYearAfterCurrentYear() { var attribute = new CurrentYearMaxValueAttribute(1990); var isValid = attribute.IsValid(DateTime.UtcNow.AddYears(1).Year); Assert.False(isValid); }
public void IsValidReturnsTrueForDateTimeBeforeCurrentYear() { var attribute = new CurrentYearMaxValueAttribute(1990); var isValid = attribute.IsValid(DateTime.UtcNow.AddYears(-1)); Assert.True(isValid); }
public void IsValidReturnsFalseForDateTimefterCurrentYear() { //Arrange var attribute = new CurrentYearMaxValueAttribute(1990); //Act var isValid = attribute.IsValid(DateTime.UtcNow.AddYears(1)); //Assert Assert.False(isValid); }
public void IsValidReturnsTrueForYearBeforeCurrentYear() { // Arange var attribute = new CurrentYearMaxValueAttribute(1990); // Act var isValid = attribute.IsValid(DateTime.UtcNow.AddYears(-1).Year); // Assert Assert.True(isValid); }
public void IsValidReturnsTrueForIntYearsAfterCurrentYear() { // Arrange var attribute = new CurrentYearMaxValueAttribute(1990); // Act var isValid = attribute.IsValid(2021); // Assert Assert.True(isValid); }