public void GetPreviousMinuteTest() { Minute minute = new Minute(); Assert.AreEqual(minute.GetPreviousMinute(), minute.AddMinutes(-1)); } // GetPreviousMinuteTest
public void GetNextMinuteTest() { Minute minute = new Minute(); Assert.AreEqual(minute.GetNextMinute(), minute.AddMinutes(1)); } // GetNextMinuteTest
public void AddMinutesTest() { DateTime now = ClockProxy.Clock.Now; DateTime nowMinute = new DateTime(now.Year, now.Month, now.Day, now.Hour, now.Minute, 0); Minute minute = new Minute(now, TimeCalendar.NewEmptyOffset()); Assert.AreEqual(minute.AddMinutes(0), minute); DateTime previousMinute = nowMinute.AddMinutes(-1); Assert.AreEqual(minute.AddMinutes(-1).Year, previousMinute.Year); Assert.AreEqual(minute.AddMinutes(-1).Month, previousMinute.Month); Assert.AreEqual(minute.AddMinutes(-1).Day, previousMinute.Day); Assert.AreEqual(minute.AddMinutes(-1).Hour, previousMinute.Hour); Assert.AreEqual(minute.AddMinutes(-1).MinuteValue, previousMinute.Minute); DateTime nextMinute = nowMinute.AddMinutes(1); Assert.AreEqual(minute.AddMinutes(1).Year, nextMinute.Year); Assert.AreEqual(minute.AddMinutes(1).Month, nextMinute.Month); Assert.AreEqual(minute.AddMinutes(1).Day, nextMinute.Day); Assert.AreEqual(minute.AddMinutes(1).Hour, nextMinute.Hour); Assert.AreEqual(minute.AddMinutes(1).MinuteValue, nextMinute.Minute); } // AddMinutes