Example #1
0
        public void testClear()
        {
            DEQueue <string> b = new DEQueue <string>();

            b.pushBack("abc");
            b.clear();
            Assert.IsTrue(b.Count == 0);
        }
Example #2
0
        public void ClearTest()
        {
            DEQueue <string> deq = new DEQueue <string>();

            deq.pushFront("a");
            deq.pushBack("b");
            deq.pushFront("c");
            Assert.IsTrue(deq.Size == 3);
            Assert.AreEqual("c", deq.Head.Data);
            Assert.AreEqual("b", deq.Tail.Data);

            deq.clear();
            Assert.IsTrue(deq.Size == 0);
            Assert.IsNull(deq.Head);
            Assert.IsNull(deq.Tail);
        }