public void Given_()
        {
            var state = TempFolderStateProvider.CreateInTempFolder("When_read_state_never_saved_before_" + Guid.NewGuid().ToString());

            _storagePath = state.StoragePath;
            _readState   = state.Retrieve("Foo1");
        }
コード例 #2
0
        public void Given_()
        {
            var state = TempFolderStateProvider.CreateInTempFolder("When_save_work_item_state_" + Guid.NewGuid().ToString());

            _storagePath = state.StoragePath;
            state.Store("Foo1", new WorkState());
        }
        public void Given_()
        {
            var state = TempFolderStateProvider.CreateInTempFolder("When_save_work_item_state_" + Guid.NewGuid().ToString());

            state.Store("Foo1", new WorkState
            {
                LastCompleteTime = new DateTime(11, 10, 09)
            });
            _readState = state.Retrieve("Foo1");
        }
コード例 #4
0
        public void Given_()
        {
            var state = TempFolderStateProvider.CreateInTempFolder("When_read_state_never_saved_before_" + Guid.NewGuid().ToString());

            _storagePath = state.StoragePath;
            Directory.CreateDirectory(_storagePath);
            File.WriteAllText(state.GetWorkItemPath("Foo1"), "Something unethical");

            _readState = state.Retrieve("Foo1");
        }
コード例 #5
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();
        }