public void SortingWithInt()
 {
     SinglyLinkedList<int> list = new SinglyLinkedList<int>(new int[] { 4, 1, 3, 2 });
     list.Sort();
     int[] expected = { 1, 2, 3, 4 };
     CollectionAssert.AreEqual(expected, list.ToArray());
 }
 public void SortUnsortedList()
 {
     SinglyLinkedList list = new SinglyLinkedList("foo", "bar");
     list.Sort();
     var expected = new string[] { "bar", "foo" };
     CollectionAssert.AreEqual(expected, list.ToArray());
 }
 public void SortEmptyList()
 {
     SinglyLinkedList list = new SinglyLinkedList();
     list.Sort();
     var expected = new string[] { };
     CollectionAssert.AreEqual(expected, list.ToArray());
 }
 public void SortUnsortedList()
 {
     SinglyLinkedList list = new SinglyLinkedList("foo", "bar");
     list.Sort();
     var expected = new string[] { "bar", "foo" };
     // This passes, but removing the ToString() fails. WHY???
     Assert.AreEqual(expected.ToString(), list.ToArray().ToString());
     // Assert.AreEqual(2, list.Count()) works
     // Assert.AreEqual("bar", list.ToArray()[0]) works
     // Assert.AreEqual("foo", list.ToArray()[1]) works
 }
 public void SortThenGetLast()
 {
     SinglyLinkedList<string> list = new SinglyLinkedList<string>("foo", "bar", "grille", "zoo", "cat");
     list.Sort();
     Assert.AreEqual("zoo", list.Last());
 }
 public void SortSortedList()
 {
     SinglyLinkedList<string> list = new SinglyLinkedList<string>("bar", "cat", "foo", "grille");
     list.Sort();
     var expected = new string[] { "bar", "cat", "foo", "grille" };
     CollectionAssert.AreEqual(expected, list.ToArray());
 }
 public void SortSingleItemList()
 {
     SinglyLinkedList<string> list = new SinglyLinkedList<string>("foo");
     list.Sort();
     var expected = new string[] { "foo" };
     CollectionAssert.AreEqual(expected, list.ToArray());
 }
 public void SortLongerList()
 {
     SinglyLinkedList list = new SinglyLinkedList("foo", "bar", "grille", "zoo", "cat");
     list.Sort();
     var expected = new string[] { "bar", "cat", "foo", "grille", "zoo" };
     //throw new ArgumentException(list.ToString());
     CollectionAssert.AreEqual(expected, list.ToArray());
 }
 public void SortEmptyList()
 {
     SinglyLinkedList list = new SinglyLinkedList();
     list.Sort();
     var expected = new string[] { };
     //hrow new ArgumentException(list.ToString());
     CollectionAssert.AreEqual(expected, list.ToArray());
 }