public void TestSortByInsertion_withInt32(int[] input)
        {
            SimpleSortedList <int> digits   = new SimpleSortedList <int>();
            IComparer <int>        comparer = Comparer <int> .Create((x, y) => x.CompareTo(y));

            digits.SortByInsertion(input, input.Length, comparer);

            Assert.That(input, Is.EquivalentTo(input.OrderBy(x => x)));
        }
        public void TestSortByInsertion_withEmptyArray()
        {
            SimpleSortedList <string> stringData = new SimpleSortedList <string>();
            IComparer <string>        comparer   = Comparer <string> .Create((x, y) => x.CompareTo(y));

            string[] input  = new string[] { };
            string[] result = new string[] { };

            stringData.SortByInsertion(input, input.Length, comparer);

            Assert.That(input, Is.EquivalentTo(result));
        }
        public void TestSortByInsertion_withString()
        {
            SimpleSortedList <string> stringData = new SimpleSortedList <string>();
            IComparer <string>        comparer   = Comparer <string> .Create((x, y) => x.CompareTo(y));

            string[] input  = new string[] { "BBBB", "aaaaa", "cccc", "Youu", "eeee", "dd" };
            string[] result = new string[] { "aaaaa", "BBBB", "cccc", "dd", "eeee", "Youu" };

            stringData.SortByInsertion(input, input.Length, comparer);

            Assert.That(input, Is.EquivalentTo(result));
        }
        public void TestSortByInsertion_withNull()
        {
            SimpleSortedList <string> digits   = new SimpleSortedList <string>();
            IComparer <string>        comparer = Comparer <string> .Create((x, y) => x.CompareTo(y));

            string[] input = null;
            try
            {
                digits.SortByInsertion(input, input.Length, comparer);
                Assert.Fail();
            }
            catch (NullReferenceException)
            {
                Assert.Pass(typeof(NullReferenceException).Name);
            }
        }