public void BitwiseSortEmptyElementsShouldNotSort() { const int MaxValue = 0; const uint BitMask = (uint)int.MaxValue + 1; Element[] elements = new Element[MaxValue]; BitwiseSortAlgorithm.BitwiseSort(elements, 0, MaxValue - 1, BitMask); CheckSortingOrder(elements); }
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); } }
public void BitwiseSortNullElementsShouldThrowException() { BitwiseSortAlgorithm.BitwiseSort(null, 0, 0, 0); }
public void BitwiseSortNullInputShouldThrowException() { BitwiseSortAlgorithm.BitwiseSort(null); }