Ejemplo n.º 1
0
        public void TestPeekFloat()
        {
            buffer.WriteFloat(1);
            buffer.WriteFloat(2);

            buffer.Reset();
            Assert.AreEqual(1, buffer.PeekFloat());
            Assert.AreEqual(2, buffer.PeekFloat(1 * sizeof(float)));

            buffer.Wipe();

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

            buffer.Wipe();
        }