public void Test_Single_Size_Circular_Buffer() { var ringBuffer = new CircularFifoBuffer <byte>(1); for (var i = 0; i < 100; i++) { ringBuffer.Write(GetBytes("ABC")); Assert.AreEqual("C", GetString(ringBuffer.ReadToArray())); ringBuffer.Write(GetBytes("D")); Assert.AreEqual("D", GetString(ringBuffer.ReadToArray())); } }
public void Test_Circular_Massive2B() { var ringBuffer = new CircularFifoBuffer <byte>(5); ringBuffer.Write(GetBytes("ABC")); Assert.AreEqual("ABC", GetString(ringBuffer.ReadToArray())); ringBuffer.Write(GetBytes("ABC")); ringBuffer.Write(GetBytes("DE")); ringBuffer.Write(GetBytes("123456789")); Assert.AreEqual("56789", GetString(ringBuffer.ReadToArray())); }
public void Test_Circular_FirstItem() { var ringBuffer = new CircularFifoBuffer <byte>(5); ringBuffer.Write(GetBytes("ABCDEFG")); Assert.AreEqual("CDEFG", GetString(ringBuffer.ReadToArray())); }
public void Test_Circular_FirstItem() { var ringBuffer = new CircularFifoBuffer<byte>(5); ringBuffer.Write(GetBytes("ABCDEFG")); Assert.AreEqual("CDEFG", GetString(ringBuffer.ReadToArray())); }
public void Test_Circular1() { var ringBuffer = new CircularFifoBuffer <byte>(5); ringBuffer.Write(GetBytes("ABC")); ringBuffer.Write(GetBytes("DE")); ringBuffer.Write(GetBytes("F")); Assert.AreEqual("BCDEF", GetString(ringBuffer.ReadToArray())); }
public void Test_Circular1() { var ringBuffer = new CircularFifoBuffer<byte>(5); ringBuffer.Write(GetBytes("ABC")); ringBuffer.Write(GetBytes("DE")); ringBuffer.Write(GetBytes("F")); Assert.AreEqual("BCDEF", GetString(ringBuffer.ReadToArray())); }
public void Test_Circular_Massive1A() { var ringBuffer = new CircularFifoBuffer<byte>(5); ringBuffer.Write(GetBytes("ABC")); Assert.AreEqual("ABC", GetString(ringBuffer.ReadToArray())); ringBuffer.Write(GetBytes("ABC")); ringBuffer.Write(GetBytes("DE")); ringBuffer.Write(GetBytes("1234567890")); Assert.AreEqual("67890", GetString(ringBuffer.ReadToArray())); }
public void Test_Single_Size_Circular_Buffer() { var ringBuffer = new CircularFifoBuffer<byte>(1); for (var i = 0; i < 100; i++) { ringBuffer.Write(GetBytes("ABC")); Assert.AreEqual("C", GetString(ringBuffer.ReadToArray())); ringBuffer.Write(GetBytes("D")); Assert.AreEqual("D", GetString(ringBuffer.ReadToArray())); } }