public void Invalid_error_handler_argument_tests() { var hostedWorkflows = new WorkflowHost(_domain, new[] { new TestWorkflow1() }); Assert.Throws <ArgumentNullException>(() => hostedWorkflows.OnError(null)); Assert.Throws <ArgumentNullException>(() => hostedWorkflows.OnResponseError(null)); Assert.Throws <ArgumentNullException>(() => hostedWorkflows.OnPollingError(null)); }
public async Task Response_exception_can_be_handled_to_continue() { _amazonWorkflowClient.SetupSequence(c => c.RespondDecisionTaskCompletedAsync(It.IsAny <RespondDecisionTaskCompletedRequest>(), It.IsAny <CancellationToken>())) .Throws(new UnknownResourceException("msg")) .Returns(Task.FromResult(new RespondDecisionTaskCompletedResponse())); var hostedWorkflows = new WorkflowHost(_domain, new[] { new WorkflowCompleteOnSignal() }); hostedWorkflows.OnResponseError(e => ErrorAction.Continue); var workflowTasks = WorkflowTask.CreateFor(DecisionTasksWithSignalEvents("token"), _domain); await workflowTasks.ExecuteForAsync(hostedWorkflows); AssertThatInterpretedDecisionsAreSentOverWorkflowClient("token", Times.Once()); }