Apache.NMS.ActiveMQ.Test.Commands.ActiveMQStreamMessageTest.TestReadDouble C# (CSharp) Method

TestReadDouble() private method

private TestReadDouble ( ) : void
return void
        public void TestReadDouble()
        {
            ActiveMQStreamMessage msg = new ActiveMQStreamMessage();

            double test = 4.4;
            msg.WriteDouble(test);
            msg.Reset();
            Assert.IsTrue(msg.ReadDouble() == test);
            msg.Reset();
            Assert.IsTrue(msg.ReadString() == (test).ToString());
            msg.Reset();
            try
            {
                msg.ReadBoolean();
                Assert.Fail("Should have thrown exception");
            }
            catch(MessageFormatException)
            {
            }
            msg.Reset();
            try
            {
                msg.ReadByte();
                Assert.Fail("Should have thrown exception");
            }
            catch(MessageFormatException)
            {
            }
            msg.Reset();
            try
            {
                msg.ReadInt16();
                Assert.Fail("Should have thrown exception");
            }
            catch(MessageFormatException)
            {
            }
            msg.Reset();
            try
            {
                msg.ReadInt32();
                Assert.Fail("Should have thrown exception");
            }
            catch(MessageFormatException)
            {
            }
            msg.Reset();
            try
            {
                msg.ReadInt64();
                Assert.Fail("Should have thrown exception");
            }
            catch(MessageFormatException)
            {
            }
            msg.Reset();
            try
            {
                msg.ReadSingle();
                Assert.Fail("Should have thrown exception");
            }
            catch(MessageFormatException)
            {
            }
            msg.Reset();
            try
            {
                msg.ReadChar();
                Assert.Fail("Should have thrown exception");
            }
            catch(MessageFormatException)
            {
            }
            msg.Reset();
            try
            {
                msg.ReadBytes(new byte[1]);
                Assert.Fail("Should have thrown exception");
            }
            catch(MessageFormatException)
            {
            }
        }