public void TestClearBody()
        {
            NmsObjectMessage objectMessage = factory.CreateObjectMessage();

            objectMessage.Body = "String";
            objectMessage.ClearBody();
            Assert.False(objectMessage.IsReadOnlyBody);
            Assert.Null(objectMessage.Body);
            objectMessage.Body = "String";
            object body = objectMessage.Body;
        }
        public void TestClearBodyOnReceivedObjectMessageMakesMessageWritable()
        {
            string content = "myStringContent";
            NmsTestObjectMessageFacade facade = new NmsTestObjectMessageFacade();

            facade.Body = content;
            NmsObjectMessage objectMessage = new NmsObjectMessage(facade);

            objectMessage.OnDispatch();

            Assert.True(objectMessage.IsReadOnlyBody);
            objectMessage.ClearBody();
            Assert.False(objectMessage.IsReadOnlyBody);
        }
        public void TestClearBodyOnReceivedObjectMessageClearsUnderlyingMessageBody()
        {
            string content = "myStringContent";
            NmsTestObjectMessageFacade facade = new NmsTestObjectMessageFacade();

            facade.Body = content;
            NmsObjectMessage objectMessage = new NmsObjectMessage(facade);

            objectMessage.OnDispatch();

            Assert.NotNull(objectMessage.Body);
            objectMessage.ClearBody();

            Assert.Null(facade.Body);
        }