Example #1
0
        public void SortTestWithoutRange()
        {
            BubbleSortV3 target = new BubbleSortV3();
            List<int> list = new List<int>();
            target.Init(list, 20);

            List<int> actual;
            actual = target.Sort(list);

            // Verify if the list is ascending from low position to high position
            for (int i = 0; i < list.Count - 1; i++)
            {
                Assert.IsTrue(actual[i] <= actual[i + 1]);
            }
        }
Example #2
0
        public void SortTest()
        {
            BubbleSortV3 target = new BubbleSortV3();
            List<int> list = new List<int>();
            target.Init(list, 20);
            int low = 10;
            int high = 15;
            List<int> actual;
            actual = target.Sort(list, low, high);

            // Verify if the list is ascending from low position to high position
            for (int i = low; i < (high - 1); i++)
            {
                Assert.IsTrue(actual[i] <= actual[i + 1]);
            }
        }