public void BitwiseSortRandomInputShouldBeSorted() { const int MaxValue = 100; NodeElement head = BitwiseSortAlgorithm.Initialize(MaxValue); head = BitwiseSortAlgorithm.BitwiseSort(head); CheckSortOrder(head); Assert.Pass("Collection is sorted"); }
public void BitwiseSortRandomElementsSholdSortCorrectly() { const int MaxValue = 100; const int TestsCount = 100; const uint BitMask = (uint)int.MaxValue + 1; Element[] elements = new Element[MaxValue]; for (int i = 0; i < TestsCount; i++) { BitwiseSortAlgorithm.Initialize(elements, MaxValue); BitwiseSortAlgorithm.BitwiseSort(elements, 0, MaxValue - 1, BitMask); CheckSortingOrder(elements); } }