示例#1
0
 static Scheduler()
 {
     DefaultHistoryStore = new DefaultHistoryStore();
 }
示例#2
0
 static Scheduler()
 {
     DefaultHistoryStore = new DefaultHistoryStore();
 }
示例#3
0
        public void TestDefaultHistoryStore()
        {
            string id1 = Guid.NewGuid().ToString("N");
            string id2 = Guid.NewGuid().ToString("N");
            string id3 = Guid.NewGuid().ToString("N");

            DefaultHistoryStore historyStore = new DefaultHistoryStore();

            Assert.AreEqual(DateTime.MinValue, historyStore.LastRun(id1));
            Assert.AreEqual(DateTime.MinValue, historyStore.LastRun(id2));
            Assert.AreEqual(DateTime.MinValue, historyStore.LastRun(id3));

            DateTime ts1 = DateTime.Now;
            DateTime ts2 = ts1.AddDays(1);
            DateTime ts3 = ts1.AddDays(2);

            historyStore.SetLastRun(id1, ts1);
            historyStore.SetLastRun(id2, ts2);
            historyStore.SetLastRun(id3, ts3);

            Assert.AreEqual(ts1, historyStore.LastRun(id1));
            Assert.AreEqual(ts2, historyStore.LastRun(id2));
            Assert.AreEqual(ts3, historyStore.LastRun(id3));
        }