AddYears() public method

public AddYears ( System.DateTime time, int years ) : System.DateTime
time System.DateTime
years int
return System.DateTime
        private void VerificationHelper(DateTime value, int addValue)
        {
            System.Globalization.Calendar tbc = new ThaiBuddhistCalendar();
            DateTime newDate = tbc.AddYears(value, addValue);
            _errorNo++;
            Assert.Equal(newDate.Year, (value.Year + addValue));

            if (value.Month == 2)
            {
                if ((IsLeapYear(value.Year) && value.Day == 29) || (!IsLeapYear(value.Year) && value.Day == 28))
                {
                    if (IsLeapYear(newDate.Year))
                    {
                        Assert.Equal(29, newDate.Day);
                    }
                    else
                    {
                        Assert.Equal(28, newDate.Day);
                    }
                }
            }
        }