public void TestMassive1000El() { var rnd = new Random(42); var array = new int[1000]; for (var i = 0; i < array.Length; i++) { array[i] = rnd.Next(-100, 100); } QuickSorting.QuickSort(array); for (var i = 0; i < 10; i++) { var j = rnd.Next(0, array.Length - 2); var k = rnd.Next(0, array.Length - 1); if (k >= j) { Assert.GreaterOrEqual(array[k], array[j]); } else { Assert.GreaterOrEqual(array[j], array[k]); } } SortingGuardian(array); }
public void TestMassive3El() { var array = new int[] { 3, 2, 1 }; QuickSorting.QuickSort(array); SortingGuardian(array); }
public void TestMassiveOver1000El() { var rnd = new Random(42); var array = new int[300000000]; for (var i = 0; i < array.Length; i++) { array[i] = rnd.Next(int.MinValue, int.MaxValue); } QuickSorting.QuickSort(array); SortingGuardian(array); }
public void TestMassive100El() { var rnd = new Random(42); var array = new int[100]; for (var i = 0; i < array.Length - 1; i++) { array[i] = rnd.Next(-100, 100); } QuickSorting.QuickSort(array); SortingGuardian(array); }
public void TestMassive0El() { QuickSorting.QuickSort(new int[0]); }