virtual public void TestPushback_byteByByte() { Assert.AreEqual(data[0], (byte)rafoa.Read()); Assert.AreEqual(data[1], (byte)rafoa.Read()); byte pushBackVal = (byte)(data[1] + 42); rafoa.PushBack(pushBackVal); Assert.AreEqual(pushBackVal, (byte)rafoa.Read()); Assert.AreEqual(data[2], (byte)rafoa.Read()); Assert.AreEqual(data[3], (byte)rafoa.Read()); }
virtual public void TestFilePositionWithPushback() { RandomAccessFileOrArray rafoa = new RandomAccessFileOrArray(new RandomAccessSourceFactory().CreateSource(data)); long offset = 72; rafoa.Seek(offset); Assert.AreEqual(offset, rafoa.FilePointer); byte pushbackVal = 42; rafoa.PushBack(pushbackVal); Assert.AreEqual(offset - 1, rafoa.FilePointer); }