public void SortExample() { var sorter = new GnomeSorter <int>(); var list = new List <int> { 13, 5, 77, 9, 12 }; sorter.Sort(list, Comparer <int> .Default); Assert.AreEqual(5, list[0]); Assert.AreEqual(9, list[1]); Assert.AreEqual(12, list[2]); Assert.AreEqual(13, list[3]); Assert.AreEqual(77, list[4]); }
public void ExceptionNullComparer1() { var sorter = new GnomeSorter<int>(); sorter.Sort(new List<int>(), (IComparer<int>)null); }
public void ExceptionNullList2() { var sorter = new GnomeSorter<int>(); sorter.Sort(null, Comparer<int>.Default); }
public void ExceptionNullList3() { var sorter = new GnomeSorter<int>(); sorter.Sort(null, SortOrder.Ascending); }
public void ExceptionNullList1() { var sorter = new GnomeSorter<int>(); sorter.Sort(null); }
public void TestGnomeSortNullComparer1() { GnomeSorter <int> sorter = new GnomeSorter <int>(); sorter.Sort(new List <int>(), (IComparer <int>)null); }
public void TestGnomeSortNullList3() { GnomeSorter <int> sorter = new GnomeSorter <int>(); sorter.Sort(null, SortOrder.Ascending); }
public void TestGnomeSortNullList2() { GnomeSorter <int> sorter = new GnomeSorter <int>(); sorter.Sort(null, Comparer <int> .Default); }
public void TestGnomeSortNullList1() { GnomeSorter <int> sorter = new GnomeSorter <int>(); sorter.Sort(null); }