Ejemplo n.º 1
0
        public void MultiInit()
        {
            Extension.Scheduler.RedisScheduler scheduler = GetRedisScheduler();

            ISpider spider = new DefaultSpider();

            scheduler.Init(spider);
            string queueKey        = scheduler.GetQueueKey();
            string setKey          = scheduler.GetSetKey();
            string itemKey         = scheduler.GetItemKey();
            string errorCountKey   = scheduler.GetErrorCountKey();
            string successCountKey = scheduler.GetSuccessCountKey();

            scheduler.Init(spider);
            Assert.Equal(queueKey, scheduler.GetQueueKey());
            Assert.Equal(setKey, scheduler.GetSetKey());
            Assert.Equal(itemKey, scheduler.GetItemKey());
            Assert.Equal(errorCountKey, scheduler.GetErrorCountKey());
            Assert.Equal(successCountKey, scheduler.GetSuccessCountKey());

            scheduler.Dispose();
            scheduler.Dispose();
        }