Ejemplo n.º 1
0
        public void TestClear()
        {
            byte[] expected = new byte[buffer.Size];

            for (int i = 0; i < expected.Length; i++)
            {
                expected[i] = (byte)r.Next(byte.MaxValue);
                buffer.WriteByte(expected[i]);
            }

            Assert.AreEqual(expected.Length, buffer.Count);

            buffer.Reset();
            Assert.AreEqual(0, buffer.Position);
            for (int i = 0; i < expected.Length; i++)
            {
                Assert.AreEqual(expected[i], buffer.Data[i]);
            }

            buffer.Wipe();
            Assert.AreEqual(0, buffer.Count);
            for (int i = 0; i < expected.Length; i++)
            {
                Assert.AreEqual(0, buffer.Data[i]);
            }
        }