Example #1
0
        public void TestRandomSequence(ISorter <int> sorter)
        {
            var input    = new int[] { 45, 11, 299, 30, 51, 0 };
            var expected = new int[] { 0, 11, 30, 45, 51, 299 };

            SorterTestsHelper.TestSorter(input, expected, sorter);
        }
Example #2
0
        public void TestReverseSortedSequence(ISorter <int> sorter)
        {
            var input    = Enumerable.Range(-3, testLength).Reverse().ToArray();
            var expected = Enumerable.Range(-3, testLength).ToArray();

            SorterTestsHelper.TestSorter(input, expected, sorter);
        }
        public void TestSortedSequence(ISorter <string> sorter)
        {
            var input    = new string[] { "a", "b", "c", "d", "e" };
            var expected = new string[] { "a", "b", "c", "d", "e" };

            SorterTestsHelper.TestSorter(input, expected, sorter);
        }
        public void TestSortedSequence(ISorter <char> sorter)
        {
            var input    = new char[] { 'a', 'b', 'c', 'd', 'e' };
            var expected = new char[] { 'a', 'b', 'c', 'd', 'e' };

            SorterTestsHelper.TestSorter(input, expected, sorter);
        }
Example #5
0
        public void TestSortedSequence(ISorter <int> sorter)
        {
            var baseSequense = Enumerable.Range(1, testLength);
            var input        = baseSequense.ToArray();
            var expected     = baseSequense.ToArray();

            SorterTestsHelper.TestSorter(input, expected, sorter);
        }
Example #6
0
        public void TestRandomSequence(ISorter <double> sorter)
        {
            var input    = new double[] { 4.5, 1.5, 2.5, 3.5, 5.5 };
            var expected = Enumerable
                           .Range(1, 5)
                           .Select(x => x + 0.5)
                           .ToArray();

            SorterTestsHelper.TestSorter(input, expected, sorter);
        }