AddYears() public method

Returns a DateTime that is the specified number of years away from the specified DateTime.
The day part of the resulting DateTime is affected if the resulting day is not a valid day in the resulting month of the resulting year; it is changed to the last valid day in the resulting month of the resulting year. The time-of-day part of the resulting DateTime remains the same as the specified DateTime. For example, Esfand has 29 days, except during leap years when it has 30 days. If the specified Date is the 30th day of Esfand in a leap year and the value of years is 1, the resulting Date will be the 29th day of Esfand in the following year. If years is negative, the resulting DateTime would be earlier than the specified DateTime.
public AddYears ( System.DateTime time, int years ) : System.DateTime
time System.DateTime The DateTime instance to add.
years int The number of years to add.
return System.DateTime
        public void Can_Add_A_Year()
        {
            var pd  = PersianDate.Now;
            var dt1 = (DateTime)pd;
            var dt2 = calendar.AddYears(dt1, 2);

            Assert.AreEqual(dt2.Year, dt1.Year + 2);
        }