Ejemplo n.º 1
0
 public QueueAttributeFacts()
 {
     _context = new ElectStateContextMock
     {
         ApplyContext = { NewStateObject = new EnqueuedState("queue") }
     };
 }
 public QueueAttributeFacts()
 {
     _context = new ElectStateContextMock
     {
         ApplyContext = { NewStateObject = new EnqueuedState("queue") }
     };
 }
Ejemplo n.º 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));
        }
        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;
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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);
        }
        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);
        }
        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();
        }
        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();
        }
        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
                }
            };
        }
Ejemplo n.º 17
0
 public QueueAttributeFacts()
 {
     _context = new ElectStateContextMock();
     _context.CandidateStateValue = new EnqueuedState("queue");
 }
Ejemplo n.º 18
0
 public QueueAttributeFacts()
 {
     _context = new ElectStateContextMock();
     _context.ApplyContext.NewStateObject = new EnqueuedState("queue");
 }
Ejemplo n.º 19
0
 public QueueAttributeFacts()
 {
     _context = new ElectStateContextMock();
     _context.ApplyContext.NewStateObject = new EnqueuedState("queue");
 }
Ejemplo n.º 20
0
 public QueueAttributeFacts()
 {
     _context = new ElectStateContextMock();
     _context.CandidateStateValue = new EnqueuedState("queue");
 }