Example #1
0
        internal StateChangeProcess(StateHandlerCollection handlers, IEnumerable<object> filters)
            : this(handlers)
        {
            if (filters == null) throw new ArgumentNullException("filters");

            _getFiltersThunk = md => filters.Select(f => new JobFilter(f, JobFilterScope.Type, null));
        }
Example #2
0
        public StateChangeProcess(StateHandlerCollection handlers)
        {
            if (handlers == null)
            {
                throw new ArgumentNullException("handlers");
            }

            _handlers = handlers;
        }
        public StateMachineFactory(JobStorage storage)
        {
            if (storage == null) throw new ArgumentNullException("storage");

            var handlers = new StateHandlerCollection();
            handlers.AddRange(GlobalStateHandlers.Handlers);
            handlers.AddRange(storage.GetStateHandlers());
            
            _stateChangeProcess = new StateChangeProcess(handlers);
        }
Example #4
0
        internal StateChangeProcess(StateHandlerCollection handlers, IEnumerable <object> filters)
            : this(handlers)
        {
            if (filters == null)
            {
                throw new ArgumentNullException("filters");
            }

            _getFiltersThunk = md => filters.Select(f => new JobFilter(f, JobFilterScope.Type, null));
        }
Example #5
0
        public StateMachineFactory(JobStorage storage)
        {
            if (storage == null)
            {
                throw new ArgumentNullException("storage");
            }

            var handlers = new StateHandlerCollection();

            handlers.AddRange(GlobalStateHandlers.Handlers);
            handlers.AddRange(storage.GetStateHandlers());

            _stateChangeProcess = new StateChangeProcess(handlers);
        }
        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);
        }
Example #7
0
        public StateChangeProcess(StateHandlerCollection handlers)
        {
            if (handlers == null) throw new ArgumentNullException("handlers");

            _handlers = handlers;
        }
 public StateHandlerCollectionFacts()
 {
     _collection = new StateHandlerCollection();
 }