示例#1
0
        public void SortCollection_OneItem()
        {
            var collection = new SortableCollection <int>(new int[] { 1 });

            collection.Sort(new SelectionSorter <int>());

            string expected = "1";
            string actual   = collection.ToString();

            Assert.AreEqual(expected, actual);
        }
示例#2
0
        public void SortCollection_OddItems()
        {
            var collection = new SortableCollection <int>(new int[] { 1, 10, 2, 9, 3, 8, 11, 4, 7, 6, 5 });

            collection.Sort(new SelectionSorter <int>());

            string expected = "1 2 3 4 5 6 7 8 9 10 11";
            string actual   = collection.ToString();

            Assert.AreEqual(expected, actual);
        }
示例#3
0
        public void SortEmptyCollection()
        {
            var collection = new SortableCollection <int>(new int[0]);

            collection.Sort(new SelectionSorter <int>());

            string expected = "";
            string actual   = collection.ToString();

            Assert.AreEqual(expected, actual);
        }