public void TestCanHandleNoInterestingProperties()
 {
     Assert.IsNotNull(RabbitMqTransportMessageExtensions.ToTransportMessage(new BasicDeliverEventArgs {
         BasicProperties = new BasicProperties {
             MessageId = "Blah"
         }
     }));
 }
        void Verify(TransportMessageBuilder builder, Action <TransportMessage, BasicDeliverEventArgs> assertion)
        {
            var message = builder.Build();

            SendMessage(message);

            var result = Consume(message.Id);

            assertion(RabbitMqTransportMessageExtensions.ToTransportMessage(result), result);
        }
        public void TestCanHandleByteArrayHeader()
        {
            var transportMessage = RabbitMqTransportMessageExtensions.ToTransportMessage(new BasicDeliverEventArgs {
                BasicProperties = new BasicProperties {
                    MessageId = "Blah", Headers = new Dictionary <string, object>()
                    {
                        { "Foo", Encoding.UTF8.GetBytes("blah") }
                    }
                }
            });

            Assert.NotNull(transportMessage);
            Assert.AreEqual("blah", transportMessage.Headers["Foo"]);
        }
        public void TestCanHandleStringObjectListHeader()
        {
            var transportMessage = RabbitMqTransportMessageExtensions.ToTransportMessage(new BasicDeliverEventArgs
            {
                BasicProperties = new BasicProperties
                {
                    MessageId = "Blah",
                    Headers   = new Dictionary <string, object>()
                    {
                        { "Foo", new List <object> {
                              "Bing"
                          } }
                    }
                }
            });

            Assert.NotNull(transportMessage);
            Assert.AreEqual("Bing", transportMessage.Headers["Foo"]);
        }
        public void TestCanHandleTablesListHeader()
        {
            var transportMessage = RabbitMqTransportMessageExtensions.ToTransportMessage(new BasicDeliverEventArgs
            {
                BasicProperties = new BasicProperties
                {
                    MessageId = "Blah",
                    Headers   = new Dictionary <string, object>
                    {
                        { "Foo", new List <object> {
                              new Dictionary <string, object> {
                                  { "key1", Encoding.UTF8.GetBytes("value1") }, { "key2", Encoding.UTF8.GetBytes("value2") }
                              }
                          } }
                    }
                }
            });

            Assert.NotNull(transportMessage);
            Assert.AreEqual("key1=value1,key2=value2", Convert.ToString(transportMessage.Headers["Foo"]));
        }