public async Task When_delayed_retries_not_supported_but_policy_demands_it_should_move_to_errors() { var recoverabilityExecutor = CreateExecutor( RetryPolicy.AlwaysDelay(TimeSpan.FromDays(1)), delayedRetriesSupported: false); var errorContext = CreateErrorContext(messageId: "message-id"); await recoverabilityExecutor.Invoke(errorContext); var failure = messageFaultedNotifications.Single(); Assert.IsEmpty(messageRetriedNotifications); Assert.AreEqual("message-id", failure.Message.MessageId); }
public async Task When_failure_is_handled_with_delayed_retries_notification_should_be_raised() { var recoverabilityExecutor = CreateExecutor(RetryPolicy.AlwaysDelay(TimeSpan.FromSeconds(10))); var errorContext = CreateErrorContext(numberOfDeliveryAttempts: 1, exceptionMessage: "test", messageId: "message-id"); await recoverabilityExecutor.Invoke(errorContext); var failure = messageRetriedNotifications.Single(); Assert.AreEqual(1, failure.Attempt); Assert.IsFalse(failure.IsImmediateRetry); Assert.AreEqual("test", failure.Exception.Message); Assert.AreEqual("message-id", failure.Message.MessageId); }