Ejemplo n.º 1
0
        public void AssertCorrectSorting()
        {
            int[] arrayToSort    = new int[] { 1, 2, 3, 0, 42, 12, 85, -54 };
            int[] expectedResult = new int[] { -54, 0, 1, 2, 3, 12, 42, 85 };
            BubbleSortClass.BubbleSort <int>(arrayToSort);

            bool areEqual = Enumerable.SequenceEqual(expectedResult, arrayToSort);

            Assert.AreEqual(true, areEqual);
        }
Ejemplo n.º 2
0
 public async void RunSort()
 {
     if (bubbleSort)
     {
         bubbleSort = false;
         BubbleSortClass bubbleSortClass = new BubbleSortClass();
         await bubbleSortClass.BubbleSort(arr);
     }
     if (mergeSort)
     {
         mergeSort = false;
     }
 }