AjErl.Tests.Communication.OutputChannelTests.WriteShortInteger C# (CSharp) Method

WriteShortInteger() private method

private WriteShortInteger ( ) : void
return void
        public void WriteShortInteger()
        {
            MemoryStream stream = new MemoryStream();
            OutputChannel channel = new OutputChannel(new BinaryWriter(stream));

            short sh = 123;

            channel.Write(sh);

            stream.Seek(0, SeekOrigin.Begin);

            BinaryReader reader = new BinaryReader(stream);

            Assert.AreEqual((byte)Types.Short, reader.ReadByte());
            Assert.AreEqual(sh, reader.ReadInt16());
            Assert.AreEqual(-1, reader.PeekChar());

            reader.Close();
        }