public void RemoveAt_RemoveLastItem_RemoveSuccessful() { int[] input = this.sampleMaxHeap; int[] expected = { 100, 19, 36, 17, 3, 25, 1, 2 }; MaxHeap <int> heap = this.CreateMaxHeapFromArray(input); heap.RemoveAt(input.Length - 1); Assert.IsTrue(heap.GetItems().SequenceEqual(expected)); }
public void RemoveAt_PassInvalidIndex_ThrowsArgumentNullException() { MaxHeap <int> heap = this.CreateMaxHeapFromArray(sampleMaxHeap); Assert.Throws <ArgumentException>(() => heap.RemoveAt(-1)); }