Apache.NMS.ActiveMQ.Test.Commands.ActiveMQTextMessageTest.TestClearBody C# (CSharp) Method

TestClearBody() private method

private TestClearBody ( ) : void
return void
        public void TestClearBody()
        {
            ActiveMQTextMessage textMessage = new ActiveMQTextMessage();
            textMessage.Text = "string";
            textMessage.ClearBody();
            Assert.IsFalse(textMessage.ReadOnlyBody);
            Assert.IsNull(textMessage.Text);
            try
            {
                textMessage.Text = "String";
                Assert.IsTrue(textMessage.Text.Length > 0);
            }
            catch(MessageNotWriteableException)
            {
                Assert.Fail("should be writeable");
            }
            catch(MessageNotReadableException)
            {
                Assert.Fail("should be readable");
            }
        }