public void ClearTest() { var q = new MPSCQueue <int>(16); //Inserts 10 items. QueueTestSetup.SplitQueue(q); Assert.AreEqual(10, q.Count); q.Clear(); Assert.AreEqual(0, q.Count); Assert.IsTrue(q.IsEmpty); }
public void MPSCQueue() { // ADD values for (int i = 0; i < COUNT; i++) { _mpscQueue.TryEnqueue(i); } for (int i = 0; i < COUNT; i++) { _mpscQueue.TryDequeue(out long result); } _mpscQueue.Clear(); }
public void EnqueueTest() { var q = new MPSCQueue <int>(10); for (int i = 0; i < 10; i++) { q.TryEnqueue(i * i); } Assert.AreEqual(10, q.Count); Assert.AreEqual(16, q.Capacity); q.Clear(); Assert.AreEqual(0, q.Count); Assert.AreEqual(16, q.Capacity); }