예제 #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);