public void TestWriteReadShort()
        {
            NmsStreamMessage streamMessage = factory.CreateStreamMessage();

            short value = 6;

            streamMessage.WriteInt16(value);
            streamMessage.Reset();

            Assert.AreEqual(value, streamMessage.ReadInt16(), "Value not as expected");
        }
        public void TestWriteShortReadLegal()
        {
            NmsStreamMessage streamMessage = factory.CreateStreamMessage();

            short value = 302;

            streamMessage.WriteInt16(value);
            streamMessage.Reset();

            AssertGetStreamEntryEquals <short>(streamMessage, true, value);
            AssertGetStreamEntryEquals <int>(streamMessage, true, value);
            AssertGetStreamEntryEquals <long>(streamMessage, true, value);
            AssertGetStreamEntryEquals <string>(streamMessage, true, value.ToString());
        }
        public void TestWriteShortReadIllegal()
        {
            NmsStreamMessage streamMessage = factory.CreateStreamMessage();

            short value = 302;

            streamMessage.WriteInt16(value);
            streamMessage.Reset();

            AssertGetStreamEntryThrowsMessageFormatException <bool>(streamMessage);
            AssertGetStreamEntryThrowsMessageFormatException <byte>(streamMessage);
            AssertGetStreamEntryThrowsMessageFormatException <char>(streamMessage);
            AssertGetStreamEntryThrowsMessageFormatException <float>(streamMessage);
            AssertGetStreamEntryThrowsMessageFormatException <double>(streamMessage);
            AssertGetStreamEntryThrowsMessageFormatException <byte[]>(streamMessage);
        }
Ejemplo n.º 4
0
 public void WriteInt16(short value)
 {
     message.WriteInt16(value);
 }