AddYears() public method

public AddYears ( int value ) : YearRange
value int
return YearRange
Esempio n. 1
0
        public void AddYearsTest()
        {
            var currentYear = new YearRange(TimeCalendar.New(April));

            currentYear.AddYears(0).Should().Be(currentYear);

            var pastYear = currentYear.AddYears(-10);

            pastYear.Start.Should().Be(currentYear.Start.AddYears(-10));
            pastYear.End.Should().Be(currentYear.End.AddYears(-10));

            var futureYear = currentYear.AddYears(10);

            futureYear.Start.Should().Be(currentYear.Start.AddYears(10));
            futureYear.End.Should().Be(currentYear.End.AddYears(10));
        }
Esempio n. 2
0
        public void AddYearsTest() {
            var currentYear = new YearRange(TimeCalendar.New(April));

            currentYear.AddYears(0).Should().Be(currentYear);

            var pastYear = currentYear.AddYears(-10);
            pastYear.Start.Should().Be(currentYear.Start.AddYears(-10));
            pastYear.End.Should().Be(currentYear.End.AddYears(-10));

            var futureYear = currentYear.AddYears(10);
            futureYear.Start.Should().Be(currentYear.Start.AddYears(10));
            futureYear.End.Should().Be(currentYear.End.AddYears(10));
        }