public void test_buffer_position() { const int size = 15; const int data = 123; var buffer = new FastBuffer(size); Assert.AreEqual(0, buffer.GetPosition()); buffer.Do(a => a.Write(data)); Assert.AreEqual(sizeof(int), buffer.GetPosition()); }
public void test_fast_buffer() { var expected = Utility.GetTestArray(16); var buffer = new FastBuffer(expected); Assert.AreEqual(expected.Length, buffer.GetCapacity()); Assert.AreSame(expected, buffer.Get()); Assert.IsTrue(buffer.Do(a => Utility.CheckTestArray(a, expected))); Assert.AreEqual(expected.Length, buffer.GetPosition()); }