public void TestWriteByte() { var backingBytes = new byte[100]; using (var buffer = new ByteArrayBuffer(backingBytes, 10, 80, false)) { Assert.AreEqual(0, backingBytes[30]); Assert.AreEqual(0, backingBytes[31]); buffer.WriteByte(20, 1); Assert.AreEqual(1, backingBytes[30]); Assert.AreEqual(0, backingBytes[31]); } }
public void TestWriteByte() { var backingBytes = new byte[100]; using (var buffer = new ByteArrayBuffer(backingBytes, 0, 0, false)) { Assert.AreEqual(0, backingBytes[0]); Assert.AreEqual(0, backingBytes[1]); buffer.WriteByte(1); Assert.AreEqual(1, backingBytes[0]); Assert.AreEqual(0, backingBytes[1]); Assert.AreEqual(1, buffer.Position); Assert.AreEqual(1, buffer.Length); } }