public void Test1() { var list = new List <int> { 5, 8, 4, 1, 2, 6, 4, 7, 9, 2 }; InsertionSorter.InsertionSort <int>(list, null); }
public void ShouldSortTwoItems() { var sorter = new InsertionSorter <int>(); int[] items = { 8, 3 }; sorter.InsertionSort(items); Assert.AreEqual(new int[] { 3, 8 }, items); }
public void ShouldSortMultipleItems() { var sorter = new InsertionSorter <int>(); int[] items = { 8, 3, 4, 12, 73, 1, 3, 4, 5 }; sorter.InsertionSort(items); Assert.AreEqual(new int[] { 1, 3, 3, 4, 4, 5, 8, 12, 73 }, items); }
public void ShouldSortEmptyArray() { var sorter = new InsertionSorter <int>(); int[] items = { }; sorter.InsertionSort(items); Assert.IsEmpty(items); }