Пример #1
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);
            }
        }