Ejemplo n.º 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));
        }
Ejemplo n.º 2
0
        internal DefaultStateChangeProcess(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));
        }
Ejemplo n.º 3
0
        private static StateHandlerCollection GetStateHandlers(JobStorage storage)
        {
            var stateHandlers = new StateHandlerCollection();
            stateHandlers.AddRange(GlobalStateHandlers.Handlers);
            stateHandlers.AddRange(storage.GetStateHandlers());

            return stateHandlers;
        }
Ejemplo n.º 4
0
        public StateMachineFactory(JobStorage storage)
        {
            if (storage == null) throw new ArgumentNullException("storage");

            _handlers = new StateHandlerCollection();
            _handlers.AddRange(GlobalStateHandlers.Handlers);
            _handlers.AddRange(storage.GetStateHandlers());
        }
Ejemplo n.º 5
0
        private static StateHandlerCollection GetStateHandlers(JobStorage storage)
        {
            var stateHandlers = new StateHandlerCollection();

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

            return(stateHandlers);
        }
Ejemplo n.º 6
0
        public StateChangeProcess(StateHandlerCollection handlers)
        {
            if (handlers == null)
            {
                throw new ArgumentNullException("handlers");
            }

            _handlers = handlers;
        }
Ejemplo n.º 7
0
        public StateMachineFactory(JobStorage storage)
        {
            if (storage == null)
            {
                throw new ArgumentNullException("storage");
            }

            _handlers = new StateHandlerCollection();
            _handlers.AddRange(GlobalStateHandlers.Handlers);
            _handlers.AddRange(storage.GetStateHandlers());
        }
Ejemplo n.º 8
0
        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);
        }
Ejemplo n.º 9
0
        public StateChangeProcess(StateHandlerCollection handlers)
        {
            if (handlers == null) throw new ArgumentNullException("handlers");

            _handlers = handlers;
        }
 public StateHandlerCollectionFacts()
 {
     _collection = new StateHandlerCollection();
 }
Ejemplo n.º 11
0
        public DefaultStateChangeProcess([NotNull] StateHandlerCollection handlers)
        {
            if (handlers == null) throw new ArgumentNullException("handlers");

            _handlers = handlers;
        }