示例#1
0
        public void TestHasBodyWithActiveOutputStream()
        {
            AmqpNmsBytesMessageFacade amqpNmsBytesMessageFacade = CreateNewBytesMessageFacade();

            Assert.False(amqpNmsBytesMessageFacade.HasBody());

            BinaryWriter binaryWriter = amqpNmsBytesMessageFacade.GetDataWriter();

            Assert.False(amqpNmsBytesMessageFacade.HasBody());

            binaryWriter.Write(1);

            // Body exists after some data written.

            Assert.True(amqpNmsBytesMessageFacade.HasBody());
            amqpNmsBytesMessageFacade.Reset();
            Assert.True(amqpNmsBytesMessageFacade.HasBody());
        }
示例#2
0
        public void TestHasBodyWithContent()
        {
            byte[] bodyBytes             = Encoding.UTF8.GetBytes("myOrigBytes");
            global::Amqp.Message message = new global::Amqp.Message
            {
                BodySection = new Data()
                {
                    Binary = bodyBytes
                }
            };

            AmqpNmsBytesMessageFacade amqpNmsBytesMessageFacade = CreateReceivedBytesMessageFacade(message);

            Assert.True(amqpNmsBytesMessageFacade.HasBody());

            amqpNmsBytesMessageFacade.ClearBody();

            Assert.False(amqpNmsBytesMessageFacade.HasBody());
        }
示例#3
0
        public void TestHasBodyOnNewMessage()
        {
            AmqpNmsBytesMessageFacade amqpNmsBytesMessageFacade = CreateNewBytesMessageFacade();

            Assert.False(amqpNmsBytesMessageFacade.HasBody());
        }