示例#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");
 }