コード例 #1
0
 public QueueAttributeFacts()
 {
     _context = new ElectStateContextMock
     {
         ApplyContext = { NewStateObject = new EnqueuedState("queue") }
     };
 }
コード例 #2
0
 public QueueAttributeFacts()
 {
     _context = new ElectStateContextMock
     {
         ApplyContext = { NewStateObject = new EnqueuedState("queue") }
     };
 }
コード例 #3
0
        public void OnStateElection_DoesNotDoAnything_IfStateIsNotEnqueuedState()
        {
            var filter = new QueueAttribute("override");
            var context = new ElectStateContextMock();
            context.ApplyContext.NewState = new Mock<IState>();

            Assert.DoesNotThrow(() => filter.OnStateElection(context.Object));
        }
コード例 #4
0
        public LatencyTimeoutAttributeFacts()
        {
            var state = new ProcessingState("Default", "1");

            _context = new ElectStateContextMock();
            _context.ApplyContext.BackgroundJob.Id = JobId;
            _context.ApplyContext.NewStateObject = state;
        }
        public LatencyTimeoutAttributeFacts()
        {
            var state = new ProcessingState("Default", "1");

            _context = new ElectStateContextMock();
            _context.ApplyContext.BackgroundJob.Id = JobId;
            _context.ApplyContext.NewStateObject   = state;
        }
コード例 #6
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));
        }
コード例 #7
0
        public RetryAttributeFacts()
        {
            _failedState = new FailedState(new InvalidOperationException());
            _connection = new Mock<IStorageConnection>();

            _context = new ElectStateContextMock();
            _context.ApplyContext.BackgroundJob.Id = JobId;
            _context.ApplyContext.Connection = _connection;
            _context.ApplyContext.NewStateObject = _failedState;
        }
コード例 #8
0
        public RetryAttributeFacts()
        {
            _failedState = new FailedState(new InvalidOperationException());
            _connection  = new Mock <IStorageConnection>();

            _context = new ElectStateContextMock();
            _context.ApplyContext.BackgroundJob.Id = JobId;
            _context.ApplyContext.Connection       = _connection;
            _context.ApplyContext.NewStateObject   = _failedState;
        }
コード例 #9
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;
        }
コード例 #10
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;
        }
コード例 #11
0
        public void OnStateElection_DoesNotDoAnything_IfStateIsNotEnqueuedState()
        {
            var filter = new QueueAttribute("override");
            var context = new ElectStateContextMock
            {
                ApplyContext = { NewState = new Mock<IState>() }
            };

            // Does not throw
            filter.OnStateElection(context.Object);
        }
コード例 #12
0
        public void OnStateElection_DoesNotDoAnything_IfStateIsNotEnqueuedState()
        {
            var filter  = new QueueAttribute("override");
            var context = new ElectStateContextMock
            {
                ApplyContext = { NewState = new Mock <IState>() }
            };

            // Does not throw
            filter.OnStateElection(context.Object);
        }
コード例 #13
0
        public StatisticsHistoryAttributeFacts()
        {
            _connection = new Mock<IStorageConnection>();

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

            _filter = new StatisticsHistoryAttribute();
        }
コード例 #14
0
        public StatisticsHistoryAttributeFacts()
        {
            _connection = new Mock <IStorageConnection>();

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

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

            _filter = new StatisticsHistoryAttribute();
        }
コード例 #15
0
        public StatisticsHistoryAttributeFacts()
        {
            _connection = new Mock<IStorageConnection>();

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

            _filter = new StatisticsHistoryAttribute();

            _context = new ElectStateContextMock
            {
                ApplyContext =
                {
                    Connection = _connection,
                    NewStateObject = new SucceededState(null, 11, 123),
                    Transaction = _transaction
                }
            };
        }
        public StatisticsHistoryAttributeFacts()
        {
            _connection = new Mock <IStorageConnection>();

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

            _filter = new StatisticsHistoryAttribute();

            _context = new ElectStateContextMock
            {
                ApplyContext =
                {
                    Connection     = _connection,
                    NewStateObject = new SucceededState(null, 11, 123),
                    Transaction    = _transaction
                }
            };
        }
コード例 #17
0
 public QueueAttributeFacts()
 {
     _context = new ElectStateContextMock();
     _context.CandidateStateValue = new EnqueuedState("queue");
 }
コード例 #18
0
 public QueueAttributeFacts()
 {
     _context = new ElectStateContextMock();
     _context.ApplyContext.NewStateObject = new EnqueuedState("queue");
 }
コード例 #19
0
 public QueueAttributeFacts()
 {
     _context = new ElectStateContextMock();
     _context.ApplyContext.NewStateObject = new EnqueuedState("queue");
 }
コード例 #20
0
 public QueueAttributeFacts()
 {
     _context = new ElectStateContextMock();
     _context.CandidateStateValue = new EnqueuedState("queue");
 }