コード例 #1
0
 public void LastOnShortList()
 {
     SinglyLinkedList list = new SinglyLinkedList();
     list.AddLast("foo");
     Assert.AreEqual("foo", list.Last());
 }
コード例 #2
0
 public void LastOnLongerList()
 {
     SinglyLinkedList list = new SinglyLinkedList();
     list.AddLast("foo");
     list.AddLast("bar");
     list.AddLast("grille");
     Assert.AreEqual("grille", list.Last());
 }
コード例 #3
0
 public void LastOnEmptyList()
 {
     SinglyLinkedList list = new SinglyLinkedList();
     Assert.AreEqual(null, list.Last());
 }
コード例 #4
0
 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());
 }