public ApplyStateContextFacts() { _connection = new Mock <IStorageConnection>(); _job = Job.FromExpression(() => Console.WriteLine()); _stateContext = new StateContextMock(); _stateContext.JobIdValue = JobId; _stateContext.JobValue = _job; _stateContext.ConnectionValue = _connection; _newState = new Mock <IState>(); _newState.Setup(x => x.Name).Returns(NewState); _filters = new List <IApplyStateFilter>(); _handlers = new StateHandlerCollection(); _transaction = new Mock <IWriteOnlyTransaction>(); _connection.Setup(x => x.CreateWriteTransaction()).Returns(_transaction.Object); }
public StateHandlerCollectionFacts() { _collection = new StateHandlerCollection(); }
private StateHandlerCollection GetHandlers() { if (_handlersCache == null) { _handlersCache = new StateHandlerCollection(); var handlers = _getHandlersThunk(_connection); foreach (var handler in handlers) { _handlersCache.AddHandler(handler); } } return _handlersCache; }