private void AssertScenario(int[] input, int[] expected, int max) { var maxHeap = new MaxHeapKata <int>(input); Assert.AreEqual(max, maxHeap.Peek()); CollectionAssert.AreEquivalent(expected, maxHeap.ToArray()); }
public void Peek_ReturnsMax_AndDoesNotRemoveElement() { var input = new int[] { 42, 1, 2 }; var maxHeap = new MaxHeapKata <int>(input); Assert.AreEqual(42, maxHeap.Peek()); CollectionAssert.AreEquivalent(input, maxHeap.ToArray()); }