public void LastOnShortList() { SinglyLinkedList list = new SinglyLinkedList(); list.AddLast("foo"); Assert.AreEqual("foo", list.Last()); }
public void LastOnLongerList() { SinglyLinkedList list = new SinglyLinkedList(); list.AddLast("foo"); list.AddLast("bar"); list.AddLast("grille"); Assert.AreEqual("grille", list.Last()); }
public void LastOnEmptyList() { SinglyLinkedList list = new SinglyLinkedList(); Assert.AreEqual(null, list.Last()); }
public void SortThenGetLast() { SinglyLinkedList<string> list = new SinglyLinkedList<string>("foo", "bar", "grille", "zoo", "cat"); list.Sort(); Assert.AreEqual("zoo", list.Last()); }
public void TestingMyLastMethodWithNoNodes() { SinglyLinkedList list = new SinglyLinkedList(); Assert.AreEqual(null, list.Last()); }
public void TestingMyLastMethodWithNodes() { SinglyLinkedList list = new SinglyLinkedList(); SinglyLinkedListNode node1 = new SinglyLinkedListNode("foo"); list.AddLast("foo"); Assert.AreEqual("foo", list.Last()); }