示例#1
0
        public void QuickSortMethod_UnsortedArray_ReturnedSortedArray()
        {
            int[] expectedArray = { 10, 45, 66, 110 };

            int[] actArray = { 110, 66, 10, 45 };
            SortMaker <int> .QuickSort(actArray);

            CollectionAssert.AreEqual(expectedArray, actArray);
        }
示例#2
0
        public void QuickSortMethod_UnsortedLargeArray_ReturnedSortedArray()
        {
            const int LargeLength = 1000000;

            int[] expectedArray = new int[LargeLength];

            expectedArray = TestHelper.GetLargeArray(LargeLength);

            int[] actArray = new int[LargeLength];
            Array.Copy(expectedArray, actArray, expectedArray.Length);
            Array.Sort(expectedArray);

            SortMaker <int> .QuickSort(actArray);

            CollectionAssert.AreEqual(expectedArray, actArray);
        }
示例#3
0
 public void QuickSortMethod_ArrayLengthEqualsNull_ThrowArgumentNullException()
 => SortMaker <int> .QuickSort(new int[] { });
示例#4
0
 public void QuickSortMethod_QuickSortWithNull_ThrowArgumentNullException()
 => SortMaker <int> .QuickSort(null);