public void MaxBinaryHeapClearTest() { MaxBinaryHeap <int, int> heap = new MaxBinaryHeap <int, int>(); Assert.AreEqual(0, heap.Size); heap.Clear(); Assert.AreEqual(0, heap.Size); heap.Insert(1, 11); heap.Insert(2, 22); Assert.AreEqual(2, heap.Size); heap.Clear(); Assert.AreEqual(0, heap.Size); }
public void MaxBinaryHeapIsEmptyTest() { MaxBinaryHeap <int, int> heap = new MaxBinaryHeap <int, int>(); Assert.IsTrue(heap.IsEmpty); heap.Insert(1, 1); heap.Insert(2, 2); Assert.IsFalse(heap.IsEmpty); heap.Clear(); Assert.IsTrue(heap.IsEmpty); }