コード例 #1
0
        public void PeekMax_ExpectCountNotChange()
        {
            var heap = new MaxBinaryHeap<int>();
            heap.Add(10);

            heap.PeekMax();

            Assert.AreEqual(1, heap.Count);
        }
コード例 #2
0
        public void PeekMax_OneItem_ExpectReturnItem()
        {
            var heap = new MaxBinaryHeap<int>();
            heap.Add(10);

            var peekedItem = heap.PeekMax();

            Assert.AreEqual(10, peekedItem);
        }
コード例 #3
0
        public void PeekMax_EmptyHeap_ExpectThrowInvalidOperationException()
        {
            var heap = new MaxBinaryHeap<int>();

            heap.PeekMax();
        }