public void When_replying_with_user_defined_message_id_should_set_defined_id_and_header()
        {
            const string expectedMessageID = "expected message id";

            var replyPipeline = new FakePipeline <IOutgoingReplyContext>();
            var context       = CreateContext(replyPipeline);
            var replyOptions  = new ReplyOptions();

            replyOptions.SetMessageId(expectedMessageID);

            MessageOperations.Reply <MyMessage>(context, m => { }, replyOptions);

            Assert.AreEqual(expectedMessageID, replyPipeline.ReceivedContext.MessageId);
            Assert.AreEqual(expectedMessageID, replyPipeline.ReceivedContext.Headers[Headers.MessageId]);
        }
        public void When_replying_should_clone_headers()
        {
            var replyPipeline = new FakePipeline <IOutgoingReplyContext>();
            var context       = CreateContext(replyPipeline);
            var replyOptions  = new ReplyOptions();

            replyOptions.SetHeader("header1", "header1 value");

            MessageOperations.Reply <MyMessage>(context, m => { }, replyOptions);
            replyPipeline.ReceivedContext.Headers.Add("header2", "header2 value");
            replyPipeline.ReceivedContext.Headers["header1"] = "updated header1 value";

            var optionsHeaders = replyOptions.GetHeaders();

            Assert.AreEqual(1, optionsHeaders.Count);
            Assert.AreEqual("header1 value", optionsHeaders["header1"]);
        }