Exemplo n.º 1
0
        public void Test_Clone()
        {
            MyDeque <int> deq1 = new MyDeque <int>();
            MyDeque <int> deq2 = new MyDeque <int>();

            deq1.EnqueueLast(1);
            deq1.EnqueueLast(2);
            deq1.EnqueueLast(3);
            deq1.EnqueueLast(4);

            deq2 = (MyDeque <int>)deq1.Clone();

            Assert.AreEqual(deq1.Count, deq2.Count);
            Assert.AreEqual(deq1.PeekLast(), deq2.PeekLast());
        }