コード例 #1
0
ファイル: CacheTest.cs プロジェクト: lanl/Omniscient
        public void DateCompactWorks()
        {
            List <DateTime> times = new List <DateTime>()
            {
                new DateTime(91),
                new DateTime(91),
                new DateTime(91),
                new DateTime(91),
                new DateTime(90),
                new DateTime(91),
                new DateTime(90),
                new DateTime(92),
                new DateTime(93),
                new DateTime(94),
                new DateTime(95),
                new DateTime(96),
                new DateTime(97),
                new DateTime(96),
                new DateTime(95),
                new DateTime(96),
            };

            List <long> cTimes = IOUtility.DateCompact(times);

            Assert.AreEqual(cTimes[0], 91);
            Assert.AreEqual(cTimes[1], 91);
            Assert.AreEqual(cTimes[2], 91);
            Assert.AreEqual(cTimes[3], 1);
            Assert.AreEqual(cTimes[4], 90);
            Assert.AreEqual(cTimes[5], 91);
            Assert.AreEqual(cTimes[6], 90);
            Assert.AreEqual(cTimes[7], 92);
            Assert.AreEqual(cTimes[8], 93);
            Assert.AreEqual(cTimes[9], 94);
            Assert.AreEqual(cTimes[10], 3);
            Assert.AreEqual(cTimes[11], 96);
            Assert.AreEqual(cTimes[12], 95);
            Assert.AreEqual(cTimes[13], 96);
        }