ExportRoutingDataTo() public method

public ExportRoutingDataTo ( IRoutableMessage message ) : void
message IRoutableMessage
return void
        public static void Test_Event_Message_Routing_Stack_Can_Export_To_Other_Message()
        {
            //arrange
            Mock<PacketPayload> packet = new Mock<PacketPayload>(MockBehavior.Strict);
            RequestMessage message = new RequestMessage(packet.Object);

            //act
            message.Push(5);
            message.Push(4);
            message.Push(3);

            ResponseMessage rMessage = new ResponseMessage(packet.Object);

            //export routing stack
            message.ExportRoutingDataTo(rMessage);

            List<IRoutableMessage> Messages = new List<IRoutableMessage>() { rMessage, message };

            foreach (IRoutableMessage m in Messages)
            {
                Assert.NotNull(m.Peek());
                Assert.True(m.isMessageRoutable);

                Assert.AreEqual(3, m.Pop());
                Assert.AreEqual(4, m.Pop());
                Assert.AreEqual(5, m.Pop());

                Assert.IsNull(m.Peek());
                Assert.IsFalse(m.isMessageRoutable);
            }
        }