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