public async Task When_failure_is_handled_by_moving_to_errors_notification_should_be_raised() { var recoverabilityExecutor = CreateExecutor(RetryPolicy.AlwaysMoveToErrors()); var errorContext = CreateErrorContext(exceptionMessage: "test", messageId: "message-id"); await recoverabilityExecutor.Invoke(errorContext); var failure = messageFaultedNotifications.Single(); Assert.AreEqual("test", failure.Exception.Message); Assert.AreEqual("message-id", failure.Message.MessageId); }
public async Task When_moving_to_custom_error_queue_custom_error_queue_address_should_be_set_on_notification() { var customErrorQueueAddress = "custom-error-queue"; var recoverabilityExecutor = CreateExecutor(RetryPolicy.AlwaysMoveToErrors(customErrorQueueAddress)); var errorContext = CreateErrorContext(); await recoverabilityExecutor.Invoke(errorContext); var failure = messageFaultedNotifications.Single(); Assert.IsEmpty(messageRetriedNotifications); Assert.AreEqual(customErrorQueueAddress, failure.ErrorQueue); }
public async Task When_moving_to_custom_error_queue_custom_error_queue_address_should_be_set_on_notification() { var customErrorQueueAddress = "custom-error-queue"; var recoverabilityExecutor = CreateExecutor(RetryPolicy.AlwaysMoveToErrors(customErrorQueueAddress)); var errorContext = CreateErrorContext(); await recoverabilityExecutor.Invoke(errorContext); var failure = eventAggregator.GetNotification <MessageFaulted>(); Assert.AreEqual(1, eventAggregator.NotificationsRaised.Count); Assert.AreEqual(customErrorQueueAddress, failure.ErrorQueue); }