public void DecreaseAmountBubbleSortIComparerTests() { for (int j = 0; j < CountRepeat; j++) { var array = SorterTestsHelper.GenerateArray(Guid.NewGuid().GetHashCode()); ArraySorter.BubbleSort(array, ComparatorFactory.GetAmountComparisonDelegate(false)); Assert.IsTrue(SorterTestsHelper.IsTrustOrder(array, arr => arr.Sum(), (a, b) => a < b)); } }
public void DecreaseMaxItemBubbleSortTests() { for (int j = 0; j < CountRepeat; j++) { var array = SorterTestsHelper.GenerateArray(Guid.NewGuid().GetHashCode()); ArraySorter.BubbleSort(array, ComparatorFactory.GetMaxItemComparer(false)); Assert.IsTrue(SorterTestsHelper.IsTrustOrder(array, arr => arr.Max(), (a, b) => a < b)); } }
public void IncreaseMinItemBubbleIComparerSortTests() { for (int j = 0; j < CountRepeat; j++) { var array = SorterTestsHelper.GenerateArray(Guid.NewGuid().GetHashCode()); ArraySorter.BubbleSort(array, ComparatorFactory.GetMinItemComparisonDelegate(true)); Assert.IsTrue(SorterTestsHelper.IsTrustOrder(array, arr => arr.Min(), (a, b) => a > b)); } }