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

            char value = 'c';

            streamMessage.WriteChar(value);
            streamMessage.Reset();

            Assert.AreEqual(value, streamMessage.ReadChar(), "Value not as expected correctly");
        }
        private object GetStreamEntryUsingTypeMethod(NmsStreamMessage testMessage, Type type, byte[] destination)
        {
            if (type == typeof(bool))
            {
                return(testMessage.ReadBoolean());
            }
            if (type == typeof(byte))
            {
                return(testMessage.ReadByte());
            }
            if (type == typeof(char))
            {
                return(testMessage.ReadChar());
            }
            if (type == typeof(short))
            {
                return(testMessage.ReadInt16());
            }
            if (type == typeof(int))
            {
                return(testMessage.ReadInt32());
            }
            if (type == typeof(long))
            {
                return(testMessage.ReadInt64());
            }
            if (type == typeof(float))
            {
                return(testMessage.ReadSingle());
            }
            if (type == typeof(double))
            {
                return(testMessage.ReadDouble());
            }
            if (type == typeof(string))
            {
                return(testMessage.ReadString());
            }
            if (type == typeof(byte[]))
            {
                return(testMessage.ReadBytes(destination));
            }

            throw new Exception("Unexpected entry type class");
        }
Example #3
0
 public char ReadChar()
 {
     return(message.ReadChar());
 }