Apache.NMS.ActiveMQ.Test.Commands.ActiveMQMapMessageTest.TestWriteOnlyBody C# (CSharp) Method

TestWriteOnlyBody() private method

private TestWriteOnlyBody ( ) : void
return void
        public void TestWriteOnlyBody()
        {
            ActiveMQMapMessage msg = new ActiveMQMapMessage();
            msg.ReadOnlyBody = false;

            msg.Body.SetBool("boolean", true);
            msg.Body.SetByte("byte", (byte)1);
            msg.Body["bytes"] = new byte[1];
            msg.Body.SetChar("char", 'a');
            msg.Body.SetDouble("double", 1.5);
            msg.Body.SetFloat("float", 1.5f);
            msg.Body.SetInt("int", 1);
            msg.Body.SetLong("long", 1);
            msg.Body["object"] = "stringObj";
            msg.Body.SetShort("short", (short)1);
            msg.Body.SetString("string", "string");

            msg.ReadOnlyBody = true;

            msg.Body.GetBool("boolean");
            msg.Body.GetByte("byte");
            Assert.IsNotNull(msg.Body["bytes"]);
            msg.Body.GetChar("char");
            msg.Body.GetDouble("double");
            msg.Body.GetFloat("float");
            msg.Body.GetInt("int");
            msg.Body.GetLong("long");
            Assert.IsNotNull(msg.Body["object"]);
            msg.Body.GetShort("short");
            msg.Body.GetString("string");
        }