public void EighteenOrNineteenYears() { DateDiffImprecise dateDiff = new DateDiffImprecise(); DateTime date = new DateTime(); date = DateTime.Parse("1997-11-8"); int n = dateDiff.Age(date); Assert.IsFalse(n < 18); Assert.IsFalse(n > 19); }
public void FiveOrSixYears() { DateDiffImprecise dateDiff = new DateSpanServer.DateDiffImprecise(); DateTime date = new DateTime(); date = DateTime.Parse("2010-11-8"); int n = dateDiff.Age(date); Assert.IsFalse(n < 5); Assert.IsFalse(n > 6); }
public int GetAge(DateTime Date) { DateDiffImprecise DateDiff = new DateDiffImprecise(); return DateDiff.Age(Date); }