Pop() public method

public Pop ( ) : object
return object
Ejemplo n.º 1
0
        public void Pop_an_empty_heap()
        {
            AMHeap heap = new AMHeap();

            object top = heap.Pop();

            Assert.IsNull(top);
        }
Ejemplo n.º 2
0
        public void Pop_one_item()
        {
            AMHeap heap = new AMHeap();

            ConstantTerm con = new ConstantTerm("ali");

            heap.Push(con);

            heap.Pop();

            Assert.IsNull(heap.Top());
        }
Ejemplo n.º 3
0
        public void Pop_two_items()
        {
            AMHeap heap = new AMHeap();

            ConstantTerm con = new ConstantTerm("ali");
            ConstantTerm first = new ConstantTerm("foo");

            heap.Push(first);
            heap.Push(con);

            heap.Pop();

            Assert.AreSame(first, heap.Top());
        }