public void Test_ISODurationsAddToDate() { ISODuration isoDuration = new ISODuration(); isoDuration.Parse("P1Y2M10D"); DateTime dt1 = isoDuration.AddToDate(new DateTime(2000, 1, 1)); DateTime dt2 = dt1; dt2.AddYears(1); dt2.AddMonths(2); dt2.AddDays(10); Assert.That(dt1, Is.EqualTo(dt2)); }
public void Test_ISODurationConvertion(string input, string iso) { ISODuration isoDuration = new ISODuration(); isoDuration.Parse(input); Assert.That(isoDuration.ToString(), Is.EqualTo(iso), "Format - " + input); }