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 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);
            }
        }