Пример #1
0
        public int[] OptimizedVersion()
        {
            int[] randomNumbers = DataGenerator.GenerateRandomNumbers();

            GenericArraySorter.IntrospectiveSort(randomNumbers, 0, randomNumbers.Length - 1, new ExperimentalComparer());

            return(randomNumbers);
        }
Пример #2
0
        public void WhenNoRulesAreSpecifiedTheDefaultComparerShouldBeUsed()
        {
            var randomNumbers     = GenerateRandomNumbers();
            var sortedByArraySort = randomNumbers.ToArray();

            Array.Sort(sortedByArraySort);

            var sortedByOptimizedArraySort = randomNumbers.ToArray();

            GenericArraySorter.IntrospectiveSort(sortedByOptimizedArraySort, 0, randomNumbers.Length - 1, new ExperimentalComparer());

            CollectionAssert.AreEqual(sortedByArraySort, sortedByOptimizedArraySort);
        }
Пример #3
0
        public int[] Integers()
        {
            GenericArraySorter.IntrospectiveSort(_smallValueTypes, 0, _smallValueTypes.Length - 1, new ArraySortersBenchmarks.ExperimentalComparer());

            return(_smallValueTypes);
        }