コード例 #1
0
ファイル: TimeKeeperTests.cs プロジェクト: skyfyl/Lean
        public void TimeKeeperReportsUpdatedLocalTimes()
        {
            var reference = new DateTime(2000, 01, 01);
            var timeKeeper = new TimeKeeper(reference, new[] { TimeZones.NewYork });
            var localTime = timeKeeper.GetTimeIn(TimeZones.NewYork);

            timeKeeper.SetUtcDateTime(reference.AddDays(1));

            Assert.AreEqual(localTime.AddDays(1), timeKeeper.GetTimeIn(TimeZones.NewYork));

            timeKeeper.SetUtcDateTime(reference.AddDays(2));

            Assert.AreEqual(localTime.AddDays(2), timeKeeper.GetTimeIn(TimeZones.NewYork));
        }
コード例 #2
0
        public void TimeKeeperReportsUpdatedLocalTimes()
        {
            var reference  = new DateTime(2000, 01, 01);
            var timeKeeper = new TimeKeeper(reference, new[] { TimeZones.NewYork });
            var localTime  = timeKeeper.GetTimeIn(TimeZones.NewYork);

            timeKeeper.SetUtcDateTime(reference.AddDays(1));

            Assert.AreEqual(localTime.AddDays(1), timeKeeper.GetTimeIn(TimeZones.NewYork));

            timeKeeper.SetUtcDateTime(reference.AddDays(2));

            Assert.AreEqual(localTime.AddDays(2), timeKeeper.GetTimeIn(TimeZones.NewYork));
        }