Exemple #1
0
        public void TestRemoveNotInList()
        {
            // This shoudln't throw any exceptions
            VisitableLinkedList <int> list = GetTestCustomLinkedList();

            list.Remove(999);
        }
Exemple #2
0
        public void TestRemoveLast()
        {
            VisitableLinkedList <int> list = GetTestCustomLinkedList();

            list.Remove(12);

            LinkedListNode <int> currentElement = list.First;

            // Verify the list items and their contents
            for (int i = 0; i < 4; i++)
            {
                Assert.AreEqual(currentElement.Value, i * 3);
                currentElement = currentElement.Next;
            }
        }