Esempio n. 1
0
        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
            };
        }
Esempio n. 2
0
        public ElectStateContextFacts()
        {
            _connection = new Mock <IStorageConnection>();

            _stateContext                 = new StateContextMock();
            _stateContext.JobIdValue      = JobId;
            _stateContext.ConnectionValue = _connection;

            _candidateState = new Mock <IState>();
        }
Esempio n. 3
0
        public ElectStateContextFacts()
        {
            _connection = new Mock<IStorageConnection>();

            _stateContext = new StateContextMock();
            _stateContext.JobIdValue = JobId;
            _stateContext.ConnectionValue = _connection;

            _candidateState = new Mock<IState>();
        }
Esempio n. 4
0
        public ApplyStateContextFacts()
        {
            _job = Job.FromExpression(() => Console.WriteLine());

            _stateContext = new StateContextMock
            {
                JobIdValue = JobId, 
                JobValue = _job,
            };

            _newState = new Mock<IState>();
            _newState.Setup(x => x.Name).Returns(NewState);
        }
Esempio n. 5
0
        public ApplyStateContextFacts()
        {
            _job = Job.FromExpression(() => Console.WriteLine());

            _stateContext = new StateContextMock
            {
                JobIdValue = JobId,
                JobValue   = _job,
            };

            _newState = new Mock <IState>();
            _newState.Setup(x => x.Name).Returns(NewState);
        }
        public StateChangeProcessFacts()
        {
            var connection = new Mock <IStorageConnection>();

            _transaction = new Mock <IWriteOnlyTransaction>();
            connection.Setup(x => x.CreateWriteTransaction()).Returns(_transaction.Object);

            _context                 = new StateContextMock();
            _context.JobIdValue      = JobId;
            _context.ConnectionValue = connection;

            _state = new Mock <IState>();
            _state.Setup(x => x.Name).Returns(StateName);
        }
        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);
        }
Esempio 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);
        }