public DefaultStateChangeProcessFacts() { _connection = new Mock <IStorageConnection>(); _transaction = new Mock <IWriteOnlyTransaction>(); _connection.Setup(x => x.CreateWriteTransaction()).Returns(_transaction.Object); _state = new Mock <IState>(); _state.Setup(x => x.Name).Returns(StateName); var context = new StateContextMock { JobIdValue = JobId }; _electStateContext = new ElectStateContextMock { StateContextValue = context, CandidateStateValue = _state.Object, CurrentStateValue = OldStateName }; _applyStateContext = new ApplyStateContextMock { StateContextValue = context, NewStateValue = _state.Object, OldStateValue = OldStateName }; }
public EnqueuedStateHandlerFacts() { _context = new ApplyStateContextMock(); _context.NewStateObject = new EnqueuedState { Queue = Queue }; _transaction = new Mock<IWriteOnlyTransaction>(); }
public FailedStateHandlerFacts() { _context = new ApplyStateContextMock(JobId); _context.NewStateValue = new FailedState(new InvalidOperationException()); _transaction = new Mock <IWriteOnlyTransaction>(); }
public ScheduledStateHandlerFacts() { _context = new ApplyStateContextMock(); _context.StateContextValue.JobIdValue = JobId; _context.NewStateValue = new ScheduledState(_enqueueAt); _transaction = new Mock <IWriteOnlyTransaction>(); }
public ScheduledStateHandlerFacts() { _context = new ApplyStateContextMock(); _context.StateContextValue.JobIdValue = JobId; _context.NewStateValue = new ScheduledState(_enqueueAt); _transaction = new Mock<IWriteOnlyTransaction>(); }
public DeletedStateHandlerFacts() { _context = new ApplyStateContextMock(); _context.StateContextValue.JobIdValue = JobId; _context.NewStateValue = new DeletedState(); _transaction = new Mock<IWriteOnlyTransaction>(); }
public ProcessingStateHandlerFacts() { _context = new ApplyStateContextMock(); _context.StateContextValue.JobIdValue = JobId; _context.NewStateValue = new ProcessingState("server", 1); _transaction = new Mock<IWriteOnlyTransaction>(); }
public SucceededStateHandlerFacts() { _context = new ApplyStateContextMock(); _context.StateContextValue.JobIdValue = JobId; _context.NewStateValue = new SucceededState(11, 123); _transaction = new Mock <IWriteOnlyTransaction>(); }
public ScheduledStateHandlerFacts() { _context = new ApplyStateContextMock(); _context.BackgroundJob.Id = JobId; _context.NewStateObject = new ScheduledState(_enqueueAt); _transaction = new Mock <IWriteOnlyTransaction>(); }
public SucceededStateHandlerFacts() { _context = new ApplyStateContextMock(); _context.StateContextValue.JobIdValue = JobId; _context.NewStateValue = new SucceededState(null, 11, 123); _transaction = new Mock<IWriteOnlyTransaction>(); }
public FailedStateHandlerFacts() { _context = new ApplyStateContextMock(); _context.StateContextValue.JobIdValue = JobId; _context.NewStateValue = new FailedState(new InvalidOperationException()); _transaction = new Mock<IWriteOnlyTransaction>(); }
public ProcessingStateHandlerFacts() { _context = new ApplyStateContextMock(); _context.StateContextValue.JobIdValue = JobId; _context.NewStateValue = new ProcessingState("server", 1); _transaction = new Mock <IWriteOnlyTransaction>(); }
public ScheduledStateHandlerFacts() { _context = new ApplyStateContextMock(); _context.BackgroundJob.Id = JobId; _context.NewStateObject = new ScheduledState(_enqueueAt); _transaction = new Mock<IWriteOnlyTransaction>(); }
public EnqueuedStateHandlerFacts() { _context = new ApplyStateContextMock(); _context.StateContextValue.JobIdValue = JobId; _context.NewStateValue = new EnqueuedState { Queue = Queue }; _transaction = new Mock<IWriteOnlyTransaction>(); _connection = new Mock<IStorageConnection>(); }
public EnqueuedStateHandlerFacts() { _context = new ApplyStateContextMock(); _context.NewStateObject = new EnqueuedState { Queue = Queue }; _transaction = new Mock <IWriteOnlyTransaction>(); }
public ScheduledStateHandlerFacts() { _context = new ApplyStateContextMock { BackgroundJob = { Id = JobId }, NewStateObject = new ScheduledState(_enqueueAt, "new_queue") }; _transaction = new Mock <IWriteOnlyTransaction>(); }
public EnqueuedStateHandlerFacts() { _context = new ApplyStateContextMock(); _context.StateContextValue.JobIdValue = JobId; _context.NewStateValue = new EnqueuedState { Queue = Queue }; _transaction = new Mock <IWriteOnlyTransaction>(); _connection = new Mock <IStorageConnection>(); }
public CoreStateMachineFacts() { _stateHandlersThunk = storage => _handlers; var backgroundJob = new BackgroundJobMock { Id = JobId }; _applyContext = new ApplyStateContextMock { BackgroundJob = backgroundJob, OldStateName = OldStateName }; _applyContext.NewState.Setup(x => x.Name).Returns(StateName); }
public StateMachineFacts() { var connection = new Mock <IStorageConnection>(); _transaction = new Mock <IWriteOnlyTransaction>(); connection.Setup(x => x.CreateWriteTransaction()).Returns(_transaction.Object); var backgroundJob = new BackgroundJobMock { Id = JobId }; _context = new ApplyStateContextMock { BackgroundJob = backgroundJob, OldStateName = OldStateName, Transaction = _transaction }; _filterProvider = new Mock <IJobFilterProvider>(); _filterProvider.Setup(x => x.GetFilters(It.IsNotNull <Job>())).Returns( _filters.Select(f => new JobFilter(f, JobFilterScope.Type, null))); _innerMachine = new Mock <IStateMachine>(); }
public ElectStateContextFacts() { _applyContext = new ApplyStateContextMock(); _applyContext.OldStateName = "State"; }
public DeletedStateHandlerFacts() { _context = new ApplyStateContextMock(JobId); _transaction = new Mock <IWriteOnlyTransaction>(); }
public AwaitingStateHandlerFacts() { _context = new ApplyStateContextMock(); }
public DeletedStateHandlerFacts() { _context = new ApplyStateContextMock(); }
public SucceededStateHandlerFacts() { _context = new ApplyStateContextMock(); }
public ElectStateContextFacts() { _applyContext = new ApplyStateContextMock { OldStateName = "State" }; }