コード例 #1
0
        public void TimeExpTest1(AprTimeExp t, string tag)
        {
            t.Time = 1087600508667156;
            Assert.AreEqual(1087600508667156, t.Time, tag + "06");
            Assert.AreEqual(1087600508667156, t.GmtTime, tag + "07");
            Assert.AreEqual(2004, t.Year, tag + "08");
            Assert.AreEqual(6, t.Month, tag + "09");
            Assert.AreEqual(18, t.Day, tag + "10");
            Assert.AreEqual(23, t.Hours, tag + "11");
            Assert.AreEqual(15, t.Minutes, tag + "12");
            Assert.AreEqual(8, t.Seconds, tag + "13");
            Assert.AreEqual(667156, t.MicroSeconds, tag + "14");
            Assert.AreEqual(5, t.WeekDay, tag + "15");
            Assert.AreEqual(169, t.YearDay, tag + "16");
            Assert.AreEqual(0, t.TimeZone, tag + "17");
            Assert.IsFalse(t.IsDaylightSaving, tag + "18");
            Assert.AreEqual("2004/06/18 23:15:08", t.ToString("%Y/%m/%d %H:%M:%S"), tag + "19");

            t.Time     = 1087607708667156;
            t.TimeZone = 7200;
            Assert.AreEqual(1087607708667156, t.Time, tag + "20");
            Assert.AreEqual(1087600508667156, t.GmtTime, tag + "21");
            Assert.AreEqual(2004, t.Year, tag + "22");
            Assert.AreEqual(6, t.Month, tag + "23");
            Assert.AreEqual(19, t.Day, tag + "24");
            Assert.AreEqual(1, t.Hours, tag + "25");
            Assert.AreEqual(15, t.Minutes, tag + "26");
            Assert.AreEqual(8, t.Seconds, tag + "26");
            Assert.AreEqual(667156, t.MicroSeconds, tag + "28");
            Assert.AreEqual(6, t.WeekDay, tag + "29");
            Assert.AreEqual(170, t.YearDay, tag + "30");
            Assert.AreEqual(7200, t.TimeZone, tag + "31");
            Assert.IsFalse(t.IsDaylightSaving, tag + "32");
            Assert.AreEqual("2004/06/19 01:15:08", t.ToString("%Y/%m/%d %H:%M:%S"), tag + "33");
        }
コード例 #2
0
 public void TimeExpTest2(AprTimeExp t, string tag)
 {
     t.SetTimeTZ(1087600508667156, 7200);
     Assert.AreEqual(1087607708667156, t.Time, tag + "34");
     Assert.AreEqual(1087600508667156, t.GmtTime, tag + "35");
     Assert.AreEqual(2004, t.Year, tag + "36");
     Assert.AreEqual(6, t.Month, tag + "37");
     Assert.AreEqual(19, t.Day, tag + "38");
     Assert.AreEqual(1, t.Hours, tag + "39");
     Assert.AreEqual(15, t.Minutes, tag + "40");
     Assert.AreEqual(8, t.Seconds, tag + "41");
     Assert.AreEqual(667156, t.MicroSeconds, tag + "42");
     Assert.AreEqual(6, t.WeekDay, tag + "43");
     Assert.AreEqual(170, t.YearDay, tag + "44");
     Assert.AreEqual(7200, t.TimeZone, tag + "45");
     Assert.IsFalse(t.IsDaylightSaving, tag + "46");
     Assert.AreEqual("2004/06/19 01:15:08", t.ToString("%Y/%m/%d %H:%M:%S"), tag + "47");
 }