コード例 #1
0
        public void GetPreviousMinuteTest()
        {
            Minute minute = new Minute();

            Assert.AreEqual(minute.GetPreviousMinute(), minute.AddMinutes(-1));
        }         // GetPreviousMinuteTest
コード例 #2
0
        public void GetNextMinuteTest()
        {
            Minute minute = new Minute();

            Assert.AreEqual(minute.GetNextMinute(), minute.AddMinutes(1));
        }         // GetNextMinuteTest
コード例 #3
0
        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