public void Given_work_item()
        {
            var factory = new WorkItemFactory();
            // Make workitem think that it was created yesterday
            factory.CurrentTime = DateTime.Now.AddDays(-1);
            _item = factory.Create();

            // Now update date to today, this
            // will make workitem applicable for scheduling
            factory.CurrentTime = DateTime.Now;

            // Force workitem to reschedule
            _item.UpdateState();
        }
        public void Given_work_item()
        {
            var ctx = new TestSchedulerContext();

            // Make workitem think that it was created yesterday
            ctx.MoveToYesterday();
            _item = WorkItemFactory.Create(ctx);

            // Now update date to today, this
            // will make workitem applicable for scheduling
            ctx.MoveToNow();

            // Force workitem to reschedule
            _item.UpdateState();
            //Console.WriteLine("bo ya:" + _item.Status);
        }
コード例 #3
0
        public void Given_()
        {
            ctx = new TestSchedulerContext();

            state = ctx.State;

            var _item = WorkItemFactory.Create(ctx);

            // Make item think that now tomorrow, so
            // it became applicable for scheduling
            ctx.MoveToTommorrow();
            _item.UpdateState();
            _item.Run();

            // and .. wait until it will complete
            Wait.Until(() => _item.Status == JobStatus.Pending);
        }
コード例 #4
0
        public void Given_work_item()
        {
            var state = TempFolderStateProvider.CreateInTempFolder("When_work_item_has_not_run_since_before_interval" + Guid.NewGuid().ToString());

            state.Store("Foo1", new WorkState {
                LastCompleteTime = new DateTime(11, 10, 09)
            });

            var ctx = new TestSchedulerContext();

            ctx.State = state;

            // Make workitem with LastComplete from 9-10-2011
            _item = WorkItemFactory.Create(ctx);

            // Force workitem to reschedule
            _item.UpdateState();
        }
コード例 #5
0
        public void Given_work_item()
        {
            var factory = new WorkItemFactory();
            _item = factory.Create();

            // Make item think that now tomorrow, so
            // it became applicable for scheduling
            factory.MoveToTommorrow();
            _item.UpdateState();
            _item.Run();

            // and .. wait until it will complete
            while (true)
            {
                if (_item.Status == WorkStatus.Pending)
                {
                    break;
                }
                Thread.Sleep(200);
            }
        }
コード例 #6
0
        public void Given_work_item()
        {
            var ctx = new TestSchedulerContext();

            _item = WorkItemFactory.Create(ctx);

            // Make item think that now tomorrow, so
            // it became applicable for scheduling
            ctx.MoveToTommorrow();
            _item.UpdateState();
            _item.Run();

            // and .. wait until it will complete
            while (true)
            {
                if (_item.Status == JobStatus.Pending)
                {
                    break;
                }
                Thread.Sleep(200);
            }
        }