public void Descending_Comparable_OutOfRange()
        {
            Assert.ThrowsException <ArgumentOutOfRangeException>(() =>
            {
                GenerateArraysDescending(SNBoseNelson.MinLength - 1, out int[] expected, out int[] actual);

                SNBoseNelson.SortDescending(ref actual[0], actual.Length);
            });
        }
        public void Descending_Comparison_ComparisonNull()
        {
            Assert.ThrowsException <ArgumentNullException>(() =>
            {
                GenerateArraysDescending(SNBoseNelson.MinLength - 1, out int[] expected, out int[] actual);

                SNBoseNelson.SortDescending(ref actual[0], actual.Length, comparison: null);
            });
        }
        public unsafe void Ascending_ComparisonPointer_OutOfRange()
        {
            Assert.ThrowsException <ArgumentOutOfRangeException>(() =>
            {
                GenerateArraysAscending(SNBoseNelson.MinLength - 1, out int[] expected, out int[] actual);

                SNBoseNelson.SortAscending(ref actual[0], actual.Length, &InternalComparison);
            });
        }
        public void Ascending_Comparison_OutOfRange()
        {
            Assert.ThrowsException <ArgumentOutOfRangeException>(() =>
            {
                GenerateArraysAscending(SNBoseNelson.MinLength - 1, out int[] expected, out int[] actual);

                SNBoseNelson.SortAscending(ref actual[0], actual.Length, (a, b) => a.CompareTo(b));
            });
        }
Пример #5
0
        public void SortAscending_Comparable()
        {
            int maximumLength = _iterationItems.Length - Length;

            for (int i = 0; i < maximumLength; i += Length)
            {
                SNBoseNelson.Sort4Ascending(ref _iterationItems[i]);
            }
        }
Пример #6
0
        public unsafe void SortAscending_ComparisonPointer()
        {
            int maximumLength = _iterationItems.Length - Length;

            for (int i = 0; i < maximumLength; i += Length)
            {
                SNBoseNelson.Sort3Ascending(ref _iterationItems[i], &InternalComparison);
            }
        }
        public void Ascending_Comparable()
        {
            for (int length = SNBoseNelson.MinLength; length <= SNBoseNelson.MaxLength; length++)
            {
                GenerateArraysAscending(length, out int[] expected, out int[] actual);

                SNBoseNelson.SortAscending(ref actual[0], length);

                CollectionAssert.AreEqual(expected, actual, $"Collections differs for length `{length}`.");
            }
        }
        public unsafe void Descending_ComparisonPointer()
        {
            for (int length = SNBoseNelson.MinLength; length <= SNBoseNelson.MaxLength; length++)
            {
                GenerateArraysDescending(length, out int[] expected, out int[] actual);

                SNBoseNelson.SortDescending(ref actual[0], length, &InternalComparison);

                CollectionAssert.AreEqual(expected, actual, $"Collections differs for length `{length}`.");
            }
        }