public void InsertTest() { var empty = BootstrappedHeap <string> .Empty; var heap = BootstrappedHeap <string> .Insert("A", empty); Assert.AreEqual("A", BootstrappedHeap <string> .FindMin(heap)); }
public void DeleteMinTest() { var ts1 = "c a b".Split().Aggregate(BootstrappedHeap <string> .Empty, (current, word) => BootstrappedHeap <string> .Insert(word, current)); var ts2 = BootstrappedHeap <string> .DeleteMin(ts1); Assert.AreEqual("b", BootstrappedHeap <string> .FindMin(ts2)); }
public void FindEmptyMinTest() { AssertThrows <ArgumentNullException>(() => BootstrappedHeap <string> .FindMin(BootstrappedHeap <string> .Empty)); }