Пример #1
0
        public void OnStateElection_DoesNotDoAnything_IfStateIsNotEnqueuedState()
        {
            var filter = new QueueAttribute("override");
            var context = new ElectStateContextMock();
            context.CandidateStateValue = new Mock<IState>().Object;

            Assert.DoesNotThrow(() => filter.OnStateElection(context.Object));
        }
Пример #2
0
        public void OnStateElection_DoesNotDoAnything_IfStateIsNotEnqueuedState()
        {
            var filter  = new QueueAttribute("override");
            var context = new ElectStateContextMock();

            context.CandidateStateValue = new Mock <IState>().Object;

            Assert.DoesNotThrow(() => filter.OnStateElection(context.Object));
        }
Пример #3
0
        public RetryAttributeFacts()
        {
            _failedState = new FailedState(new InvalidOperationException());
            _connection  = new Mock <IStorageConnection>();

            _context = new ElectStateContextMock();
            _context.StateContextValue.JobIdValue      = JobId;
            _context.StateContextValue.ConnectionValue = _connection;
            _context.CandidateStateValue = _failedState;
        }
Пример #4
0
        public RetryAttributeFacts()
        {
            _failedState = new FailedState(new InvalidOperationException());
            _connection = new Mock<IStorageConnection>();

            _context = new ElectStateContextMock();
            _context.StateContextValue.JobIdValue = JobId;
            _context.StateContextValue.ConnectionValue = _connection;
            _context.CandidateStateValue = _failedState;
        }
        public StatisticsHistoryAttributeFacts()
        {
            _connection = new Mock<IStorageConnection>();

            _context = new ElectStateContextMock();
            _context.StateContextValue.ConnectionValue = _connection;
            _context.CandidateStateValue = new SucceededState(11, 123);
            
            _transaction = new Mock<IWriteOnlyTransaction>();
            _connection.Setup(x => x.CreateWriteTransaction()).Returns(_transaction.Object);

            _filter = new StatisticsHistoryAttribute();
        }
Пример #6
0
        public StatisticsHistoryAttributeFacts()
        {
            _connection = new Mock <IStorageConnection>();

            _context = new ElectStateContextMock();
            _context.StateContextValue.ConnectionValue = _connection;
            _context.CandidateStateValue = new SucceededState(11, 123);

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

            _filter = new StatisticsHistoryAttribute();
        }
Пример #7
0
 public QueueAttributeFacts()
 {
     _context = new ElectStateContextMock();
     _context.CandidateStateValue = new EnqueuedState("queue");
 }
Пример #8
0
 public QueueAttributeFacts()
 {
     _context = new ElectStateContextMock();
     _context.CandidateStateValue = new EnqueuedState("queue");
 }