public void Test1()
        {
            var list = new List <int>()
            {
                8, 5, 5, 2, 1, 4, 8, 54, 5, 1, 5, 2, 21, 55
            };

            CycleSorter.CycleSort <int>(list, null);
        }
Ejemplo n.º 2
0
        public static void ArraySorted([Random(0, 1000, 100, Distinct = true)] int n)
        {
            // Arrange
            var sorter      = new CycleSorter <int>();
            var intComparer = new IntComparer();

            var(correctArray, testArray) = RandomHelper.GetArrays(n);

            // Act
            sorter.Sort(testArray, intComparer);
            Array.Sort(correctArray);

            // Assert
            Assert.AreEqual(correctArray, testArray);
        }