public async Task It_restores_body_id_and_target_addres_after_failure()
        {
            var sender = new FaultySender();

            var headers = new Dictionary <string, string>
            {
                ["ServiceControl.Retry.StagingId"]         = "SomeId",
                ["ServiceControl.TargetEndpointAddress"]   = "TargetEndpoint",
                ["ServiceControl.Retry.Attempt.MessageId"] = "MessageBodyId"
            };
            var message = CreateMessage(Guid.NewGuid().ToString(), headers);

            try
            {
                await new ReturnToSender(new FakeBodyStorage()).HandleMessage(message, sender)
                .ConfigureAwait(false);
            }
            catch (Exception)
            {
                //Intentionally empty catch
            }

            Assert.IsTrue(message.Headers.ContainsKey("ServiceControl.TargetEndpointAddress"));
            Assert.IsTrue(message.Headers.ContainsKey("ServiceControl.Retry.Attempt.MessageId"));
        }
        public void It_restores_body_id_and_target_addres_after_failure()
        {
            var sender = new FaultySender();

            var headers = new Dictionary <string, string>
            {
                ["ServiceControl.Retry.StagingId"]         = "SomeId",
                ["ServiceControl.TargetEndpointAddress"]   = "TargetEndpoint",
                ["ServiceControl.Retry.Attempt.MessageId"] = "MessageBodyId",
            };
            var message = new TransportMessage(Guid.NewGuid().ToString(), headers);

            try
            {
                ReturnToSenderDequeuer.HandleMessage(message, new FakeBodyStorage(), sender);
            }
            catch (Exception)
            {
                //Intentionally empty catch
            }
            Assert.IsTrue(message.Headers.ContainsKey("ServiceControl.TargetEndpointAddress"));
            Assert.IsTrue(message.Headers.ContainsKey("ServiceControl.Retry.Attempt.MessageId"));
        }