Пример #1
0
        public void SetUp()
        {
            theSchedule = new JobSchedule();


            theRule = new StubbedScheduleRule();

            theRule.ScheduledTimes[now] = next;

            theExecutor = new StubJobExecutor();

            theJob = new ScheduledJob <AJob>(theRule);

            theLastRun = new JobExecutionRecord();
            theSchedule.Find(theJob.JobType)
            .LastExecution = theLastRun;

            theJob.As <IScheduledJob>().Initialize(now, theExecutor, theSchedule);
        }
Пример #2
0
        public void SetUp()
        {
            theExecutor = new StubJobExecutor();

            theSchedule = new JobSchedule(new[]
            {
                JobStatus.For <AJob>(DateTime.Today),
                JobStatus.For <BJob>(DateTime.Today.AddHours(1)),
                JobStatus.For <CJob>(DateTime.Today.AddHours(2)),
            });

            theGraph = new ScheduledJobGraph();
            theGraph.Jobs.Add(new ScheduledJob <BJob>(new DummyScheduleRule(DateTime.Today.AddHours(1))));
            theGraph.Jobs.Add(new ScheduledJob <CJob>(new DummyScheduleRule(DateTime.Today.AddHours(3))));
            theGraph.Jobs.Add(new ScheduledJob <DJob>(new DummyScheduleRule(DateTime.Today.AddHours(4))));
            theGraph.Jobs.Add(new ScheduledJob <EJob>(new DummyScheduleRule(DateTime.Today.AddHours(5))));

            // not that worried about pushing the time around
            theGraph.DetermineSchedule(now, theExecutor, theSchedule);
        }