Пример #1
0
        public void BubbleSortEmptyElementsShouldNotSort()
        {
            const int MaxValue = 0;

            Element[] elements = new Element[MaxValue];
            BubbleSortingAlgorithm.BubbleSort(elements);
            CheckSortingOrder(elements);
        }
Пример #2
0
        public void BubbleSortRandomElementsSholdSortCorrectly()
        {
            const int MaxValue   = 100;
            const int TestsCount = 100;

            Element[] elements = new Element[MaxValue];
            for (int i = 0; i < TestsCount; i++)
            {
                BubbleSortingAlgorithm.Initialize(elements);
                BubbleSortingAlgorithm.BubbleSort(elements);
                CheckSortingOrder(elements);
            }
        }
Пример #3
0
 public void BubbleSortNullElementsShouldThrowException()
 {
     BubbleSortingAlgorithm.BubbleSort(null);
 }