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()); }
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()); }
public void TestHasBodyOnNewMessage() { AmqpNmsBytesMessageFacade amqpNmsBytesMessageFacade = CreateNewBytesMessageFacade(); Assert.False(amqpNmsBytesMessageFacade.HasBody()); }