public void WorkflowEventsIteratorGetEnumeratorTest() { var iterator = new WorkflowEventsIterator(ref _decisionTask, _pollforDecisionTaskRequest, _amazonSwf); foreach (HistoryEvent historyEvent in iterator) { Assert.NotNull(historyEvent.EventType); } }
/// <summary> /// Constructor for the workflow event processor. /// </summary> /// <param name="decisionTask">Decision task passed in from SWF as decision task response.</param> /// <param name="workflows">IEnumerable set of string for workflow name and Type for workflow class.</param> /// <param name="request">The request used to retrieve <paramref name="decisionTask"/>, which will be used to retrieve subsequent history event pages.</param> /// <param name="swfClient">An SWF client.</param> public WorkflowEventsProcessor(DecisionTask decisionTask, IEnumerable<KeyValuePair<string, Type>> workflows, PollForDecisionTaskRequest request, IAmazonSimpleWorkflow swfClient) { // Decision task can't be null. if (decisionTask == null) { throw new ArgumentNullException("decisionTask"); } if (request == null) { throw new ArgumentNullException("request"); } // Store the decision task and allocate a new decision context and event dictionary which // we will use as we walk through the chain of events _decisionTask = decisionTask; _request = request; _decisionContext = new WorkflowDecisionContext(); _swfClient = swfClient; // Set up our events data structure _events = new WorkflowEventsIterator(ref decisionTask, _request, _swfClient); _workflows = (Dictionary<string, Type>) workflows; }
public void WorkflowEventsIteratorConstructorEventsTest(int eventID) { var iterator = new WorkflowEventsIterator(ref _decisionTask, _pollforDecisionTaskRequest, _amazonSwf); Assert.NotNull(iterator[eventID]); }