public static void Consolidate_EmptyHeap_DoesNothing() { var heap = new TestFHeap(); heap.RawConsolidate(); Assert.Throws <InvalidOperationException>(() => heap.Peek()); }
public static void Cut_EmptyHeap_ThrowsCorrectExcpetion() { var heap = new TestFHeap(); var item1 = new FHeapNode <int>(1); var item2 = new FHeapNode <int>(2); Assert.Throws <InvalidOperationException>(() => heap.RawCut(item1, item2)); }
public static void Cut_FilledHeap_AlteredItem() { var heap = new TestFHeap(); var item1 = heap.Push(1); var item2 = heap.Push(2); item2.Degree = -1; Assert.Throws <InvalidOperationException>(() => heap.RawCut(item1, item2)); }