本文整理汇总了C#中RingBuffer.Remove方法的典型用法代码示例。如果您正苦于以下问题:C# RingBuffer.Remove方法的具体用法?C# RingBuffer.Remove怎么用?C# RingBuffer.Remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RingBuffer
的用法示例。
在下文中一共展示了RingBuffer.Remove方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ItemIsRemoved
public void ItemIsRemoved() {
RingBuffer<int> _buffer = new RingBuffer<int>(iterations);
populateBuffer(iterations, _buffer);
int _preRemoveSize = _buffer.Count;
_buffer.Remove(0);
Assert.AreEqual(false, _buffer.Contains(0));
Assert.AreEqual(_preRemoveSize - 1, _buffer.Count);
}
示例2: PeekTest_1
public void PeekTest_1()
{
RingBuffer<int> rb = new RingBuffer<int>(4);
rb.Add(3);
rb.Add(5);
int p1 = rb.Peek();
int d1 = rb.Remove();
int p2 = rb.Peek();
int d2 = rb.Remove();
Assert.AreEqual(3, p1);
Assert.AreEqual(5, p2);
Assert.AreEqual(3, d1);
Assert.AreEqual(5, d2);
}
示例3: QueueTest_3
public void QueueTest_3()
{
RingBuffer<int> rb = new RingBuffer<int>(4);
rb.Add(2);
rb.Add(4);
rb.Add(6);
rb.Add(8);
rb.Add(9);
int d1 = rb.Remove();
int d2 = rb.Remove();
int d3 = rb.Remove();
int d4 = rb.Remove();
Assert.AreEqual(4, d1);
Assert.AreEqual(6, d2);
Assert.AreEqual(8, d3);
Assert.AreEqual(9, d4);
Assert.IsTrue(rb.IsEmpty);
}
示例4: QueueTest_2
public void QueueTest_2()
{
RingBuffer<int> rb = new RingBuffer<int>(4);
rb.Add(5);
rb.Add(8);
int d1 = rb.Remove();
int d2 = rb.Remove();
Assert.AreEqual(5, d1);
Assert.AreEqual(8, d2);
}
示例5: QueueTest_1
public void QueueTest_1()
{
RingBuffer<int> rb = new RingBuffer<int>(4);
rb.Add(3);
int d = rb.Remove();
Assert.AreEqual(3, d);
}
示例6: QueueTest_0
public void QueueTest_0()
{
RingBuffer<int> rb = new RingBuffer<int>(4);
int d = rb.Remove();
}