Пример #1
0
        public void AppendListTest()
        {
            //also a test of the DisplayList method
            //first linkedList
            linkedList.AddHead('a'); //tail
            linkedList.AddHead('b');
            linkedList.AddHead('a');
            linkedList.AddHead('d'); //head

            //second linkedList2
            linkedList.AddHead('a'); //tail
            linkedList.AddHead('b');
            linkedList.AddHead('a');
            linkedList.AddHead('d'); //head

            linkedList.AppendList(linkedList2);
            Assert.AreEqual("d a b a d a b a ", linkedList.DisplayList());
        }
Пример #2
0
        public void AppendListTest()
        {
            //also a test of the DisplayList method
            //first linkedList
            studentList.AddHead(studentA); //tail
            studentList.AddHead(studentB);
            studentList.AddHead(studentC);
            studentList.AddHead(studentD); //head

            //second linkedList2
            studentList2.AddHead(studentE); //tail
            studentList2.AddHead(studentF);
            studentList2.AddHead(studentC);
            studentList2.AddHead(studentD); //head

            studentList.AppendList(studentList2);
            Assert.AreEqual("Terry Brian Jerry Sally Terry Brian Marry Bob ", studentList.DisplayList());
        }