Beispiel #1
0
        public void TestPeekShort()
        {
            buffer.WriteShort(1);
            buffer.WriteShort(2);

            buffer.Reset();
            Assert.AreEqual(1, buffer.PeekShort());
            Assert.AreEqual(2, buffer.PeekShort(1 * sizeof(short)));

            buffer.Wipe();

            buffer.WriteShortArray(new short[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 });
            buffer.Reset();
            Assert.AreEqual(4, buffer.PeekShort(sizeof(byte) + 3 * sizeof(short)));
            Assert.AreEqual(5, buffer.PeekShort(sizeof(byte) + 4 * sizeof(short)));

            buffer.Wipe();
        }