public void DeleteTest(IHeap <int> heap, bool isMin) { var num = RandomNumber(); var tmpLst = new List <int>(TestList) { num }; tmpLst.Remove(num); tmpLst.Sort(); if (!isMin) { tmpLst.Reverse(); } var node = heap.Insert(num); heap.Delete(node); var heapList = GetHeapList(isMin).ToList(); Console.WriteLine("isMin:" + isMin); Console.WriteLine("Expect:" + string.Join(", ", tmpLst)); Console.WriteLine("Result:" + string.Join(", ", heapList)); Assert.IsTrue(tmpLst.SequenceEqual(heapList)); }