public async Task By_default_execution_method_convert_exception_to_failed_response() { var activity = new ActivityThrowingException(new IndexOutOfRangeException("blah")); var actualResponse = await activity.ExecuteAsync(_activityArgs); Assert.That(actualResponse, Is.EqualTo(new ActivityFailResponse(_taskToken, "IndexOutOfRangeException", "blah"))); }
public async Task Activity_convert_the_exception_to_fail_reponse_without_using_error_handler() { var activity = new ActivityThrowingException(new IndexOutOfRangeException("blah")); activity.SetErrorHandler(ErrorHandler.Continue); var actualResponse = await activity.ExecuteAsync(_activityArgs); Assert.That(actualResponse, Is.EqualTo(new ActivityFailResponse(_taskToken, "IndexOutOfRangeException", "blah"))); }
public void Activity_can_be_customized_to_not_convert_exception_to_failed_response() { var activity = new ActivityThrowingException(new IndexOutOfRangeException("blah"), failOnException: false); Assert.ThrowsAsync <IndexOutOfRangeException>(async() => await activity.ExecuteAsync(_activityArgs)); }