public void SetUp() { var rule = new StubbedScheduleRule(); rule.ScheduledTimes[now] = theNextTimeAccordingToTheSchedulerRule; TheJobTracker.Stub(x => x.Now()).Return(now); var job = theJobIs(); var scheduledJob = new ScheduledJob <RiggedJob>(rule); scheduledJob.Timeout = theConfiguredTimeout; theTask = scheduledJob.ToTask(job, TheJobTracker); try { theTask.Wait(); } catch (Exception) { // okay to swallow because you'll // check it on task itself } }
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); }
public NextTimeExpression(StubbedScheduleRule parent, DateTimeOffset next) { _parent = parent; _next = next; }