public void NextYearButLessThanAYear() { var t2 = new DateTime(2010, 7, 10); var o = new PeriodOfTimeOutput(basePast, t2); Assert.AreEqual("10 months, 1 week, 2 days", o.ToString()); }
public void NextMonthButLessThanAMonth() // Worked without changing code { var thePast = new DateTime(2009, 9, 10); var t2 = new DateTime(2009, 10, 2); var o = new PeriodOfTimeOutput(thePast, t2); Assert.AreEqual("3 weeks, 1 day", o.ToString()); }
public void YearsAreAlsoOutput() { var t2 = new DateTime(2010, 9, 1); var o = new PeriodOfTimeOutput(basePast, t2); Assert.AreEqual("1 year", o.ToString()); }
public void CombinationOfYearMonthWeekAndDayIsPossible() { var t2 = new DateTime(2010, 11, 10); var o = new PeriodOfTimeOutput(basePast, t2); Assert.AreEqual("1 year, 2 months, 1 week, 2 days", o.ToString()); }
public void MonthsAreAlsoOutput() { var t2 = new DateTime(2009, 10, 1); var o = new PeriodOfTimeOutput(basePast, t2); Assert.AreEqual("1 month", o.ToString()); }
public void CombinationsOfMonthAndWeekAndDayArePossible() { var t2 = new DateTime(2009, 10, 10); var o = new PeriodOfTimeOutput(basePast, t2); Assert.AreEqual("1 month, 1 week, 2 days", o.ToString()); }
public void WeeksAppearWhenMoreThanAWeek() { var t2 = new DateTime(2009, 9, 17); var o = new PeriodOfTimeOutput(basePast, t2); Assert.AreEqual("2 weeks, 2 days", o.ToString()); }
public void WeeksAreCorrectlyInflected() { var t2 = new DateTime(2009, 9, 9); var o = new PeriodOfTimeOutput(basePast, t2); Assert.AreEqual("1 week, 1 day", o.ToString()); }
public void SmallestUnitIsToday() { var t2 = basePast; var o = new PeriodOfTimeOutput(basePast, t2); Assert.AreEqual("today", o.ToString()); }
public void CorrectlyOutputsASmallPeriodWithinWeek() { var t2 = new DateTime(2009, 9, 6); var o = new PeriodOfTimeOutput(basePast, t2); Assert.AreEqual("5 days", o.ToString()); }
public void IssueInFindingAMonthWhenPastDateIs31St() { var past = new DateTime(2009, 8, 31); var now = new DateTime(2009, 10, 1); var o = new PeriodOfTimeOutput(past, now); Assert.AreEqual("1 month, 1 day", o.ToString()); }
public void AVariantOfALongInterval() { var t2 = new DateTime(2012, 8, 30); var o = new PeriodOfTimeOutput(basePast, t2); Assert.AreEqual("2 years, 11 months, 4 weeks, 1 day", o.ToString()); }
public void NextYearButLessThanAYearVariant2() { var otherBase = new DateTime(2009, 9, 10); var t2 = new DateTime(2010, 6, 2); var o = new PeriodOfTimeOutput(otherBase, t2); Assert.AreEqual("8 months, 3 weeks, 2 days", o.ToString()); }