public void QueueCanBeConvertedIntoArray() { var queue = new LeakyQueue <int>(); for (int index = 0; index < 4; ++index) { queue.Enqueue(index); } Assert.AreEqual( new int[] { 0, 1, 2, 3 }, queue.ToArray() ); }
public void InternallyWrappedQueueCanBeConvertedIntoArray() { var queue = new LeakyQueue <int>(); for (int index = 0; index < 4; ++index) { queue.Enqueue(index); } queue.Dequeue(); queue.Dequeue(); for (int index = 4; index < 6; ++index) { queue.Enqueue(index); } Assert.AreEqual( new int[] { 2, 3, 4, 5 }, queue.ToArray() ); }