Beispiel #1
0
        public void DecreaseAmountBubbleSortTests()
        {
            for (int j = 0; j < CountRepeat; j++)
            {
                var array = SorterTestsHelper.GenerateArray(Guid.NewGuid().GetHashCode());

                ArraySorter.BubbleSort(array, ComparatorFactory.GetAmountComparer(false));

                Assert.IsTrue(SorterTestsHelper.IsTrustOrder(array, arr => arr.Sum(), (a, b) => a < b));
            }
        }
Beispiel #2
0
        public void BubbleSortTest_ArrayIsNull_ThrowsArgumentNullException(int[][] array)
        {
            var comparator = ComparatorFactory.GetAmountComparer(true);

            Assert.Throws <ArgumentNullException>(() => ArraySorter.BubbleSort(array, comparator));
        }