public void ToLinkedList() { var queue = new Queue<int>(); queue.Enqueue(1); queue.Enqueue(2); queue.Enqueue(3); queue.Enqueue(4); queue.Enqueue(5); var linkedList = queue.ToLinkedList(); //Prove Idempotency of the Queue (doesn't destroy the queue) Assert.AreEqual(5, queue.Count); //Ensure linked list in in the same order Assert.AreEqual(5, linkedList.Count); Assert.AreEqual(1, linkedList.First.Value); Assert.AreEqual(2, linkedList.First.Next.Value); Assert.AreEqual(3, linkedList.First.Next.Next.Value); Assert.AreEqual(4, linkedList.First.Next.Next.Next.Value); Assert.AreEqual(5, linkedList.First.Next.Next.Next.Next.Value); }