public QueueAttributeFacts() { _context = new ElectStateContextMock { ApplyContext = { NewStateObject = new EnqueuedState("queue") } }; }
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 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)); }
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; }
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; }
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 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 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 } }; }
public QueueAttributeFacts() { _context = new ElectStateContextMock(); _context.CandidateStateValue = new EnqueuedState("queue"); }
public QueueAttributeFacts() { _context = new ElectStateContextMock(); _context.ApplyContext.NewStateObject = new EnqueuedState("queue"); }