public void Given_work_item()
 {
     _item = new WorkItem(new DefaultWorkContext(), "Foo1", () =>
     {
         return Task.Factory.StartNew(() => Console.WriteLine("Foo1"));
     }, TimeSpan.FromMinutes(10));
 }
        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();
        }