public void EnqueueTwoItemsDequeuBottomItem() { var queue = new QueueAsList <string>(); queue.Enqueue("test"); queue.Enqueue("other test"); Assert.AreEqual("test", queue.Dequeue()); }
public void EnqueueTwoItemsCountIs2() { var queue = new QueueAsList <string>(); queue.Enqueue("test"); queue.Enqueue("other test"); Assert.AreEqual(2, queue.Count); }
public void EnqueueTwoItemsDequeueRemainsSecond() { var queue = new QueueAsList <string>(); queue.Enqueue("test"); queue.Enqueue("other test"); queue.Dequeue(); Assert.AreEqual(1, queue.Count); Assert.AreEqual("other test", queue.Dequeue()); }
public void EnqueueItemCanDequeueItem() { var queue = new QueueAsList <string>(); queue.Enqueue("test"); Assert.AreEqual("test", queue.Dequeue()); }
public void EnqueueItemCountIs1() { var queue = new QueueAsList <string>(); queue.Enqueue("test"); Assert.AreEqual(1, queue.Count); }
public void ClearQueueCantDequeueItem() { var queue = new QueueAsList <string>(); queue.Enqueue("test"); queue.Clear(); queue.Dequeue(); }
public void ClearQueueResetsCountTo0() { var queue = new QueueAsList <string>(); queue.Enqueue("test"); queue.Clear(); Assert.AreEqual(0, queue.Count); }
public void QueueOneItemCanIterate() { var queue = new QueueAsList <string>(); queue.Enqueue("test"); foreach (var item in queue) { Assert.AreEqual("test", item); } }
public void QueueAddFiveItemsIterateInOrder() { var queue = new QueueAsList <int>(); for (int i = 0; i < 5; i++) { queue.Enqueue(i); } var num = 0; foreach (var item in queue) { Assert.AreEqual(num, item); num++; } }