Пример #1
0
        public void SortExample()
        {
            var sorter = new GnomeSorter <int>();

            var list = new List <int> {
                13, 5, 77, 9, 12
            };

            sorter.Sort(list, Comparer <int> .Default);

            Assert.AreEqual(5, list[0]);
            Assert.AreEqual(9, list[1]);
            Assert.AreEqual(12, list[2]);
            Assert.AreEqual(13, list[3]);
            Assert.AreEqual(77, list[4]);
        }
Пример #2
0
		public void ExceptionNullComparer1()
        {
            var sorter = new GnomeSorter<int>();
            sorter.Sort(new List<int>(), (IComparer<int>)null);
        }
Пример #3
0
		public void ExceptionNullList2()
        {
            var sorter = new GnomeSorter<int>();
            sorter.Sort(null, Comparer<int>.Default);
        }
Пример #4
0
		public void ExceptionNullList3()
        {
            var sorter = new GnomeSorter<int>();
            sorter.Sort(null, SortOrder.Ascending);
        }
Пример #5
0
		public void ExceptionNullList1()
        {
            var sorter = new GnomeSorter<int>();
            sorter.Sort(null);
        }
Пример #6
0
        public void TestGnomeSortNullComparer1()
        {
            GnomeSorter <int> sorter = new GnomeSorter <int>();

            sorter.Sort(new List <int>(), (IComparer <int>)null);
        }
Пример #7
0
        public void TestGnomeSortNullList3()
        {
            GnomeSorter <int> sorter = new GnomeSorter <int>();

            sorter.Sort(null, SortOrder.Ascending);
        }
Пример #8
0
        public void TestGnomeSortNullList2()
        {
            GnomeSorter <int> sorter = new GnomeSorter <int>();

            sorter.Sort(null, Comparer <int> .Default);
        }
Пример #9
0
        public void TestGnomeSortNullList1()
        {
            GnomeSorter <int> sorter = new GnomeSorter <int>();

            sorter.Sort(null);
        }