public void IsValidReturnsFalseForDateBeforeToday() { var attribute = new UpToYearAttribute(); var isValid = attribute.IsValid(DateTime.UtcNow.AddDays(-1)); Assert.False(isValid); }
public void IsValidReturnsTrueForDateInBetweenNowAndOneYearAhead() { var attribute = new UpToYearAttribute(); var isValid = attribute.IsValid(DateTime.UtcNow.AddMonths(6)); Assert.True(isValid); }
public void IsValidReturnsFalseForDateAfterAYear() { var attribute = new UpToYearAttribute(); var isValid = attribute.IsValid(DateTime.UtcNow.AddYears(1).AddSeconds(1)); Assert.False(isValid); }