public void ReturnValuesInFIFOOrderingAfterModifications() { QueueViaStacks <int> queue = CreateQueueViaStacksFromArray(new [] { 9, 6, 1, 2 }); Assert.Equal(9, queue.Peek()); Assert.Equal(9, queue.Remove()); Assert.Equal(6, queue.Remove()); queue.Add(3); queue.Add(4); CollectionsEqual(new [] { 1, 2, 3, 4 }, queue); }
private static QueueViaStacks <int> CreateQueueViaStacksFromArray(int[] input) { QueueViaStacks <int> queue = new QueueViaStacks <int>(); foreach (var item in input) { queue.Add(item); } return(queue); }