Ejemplo n.º 1
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());
        }
Ejemplo n.º 2
0
 public void AddHeadTest()
 {
     //also a test of the DisplayList method
     //tail
     linkedList.AddHead('a');
     linkedList.AddHead('b');
     linkedList.AddHead('c');
     linkedList.AddHead('d');
     //head
     //prints backwards
     Assert.AreEqual("d c b a ", linkedList.DisplayList());
 }
Ejemplo n.º 3
0
 public void AddHeadTest()
 {
     //also a test of the DisplayList method
     //tail
     studentList.AddHead(studentA); //tail
     studentList.AddHead(studentB);
     studentList.AddHead(studentC);
     studentList.AddHead(studentD); //head
     //head
     //prints backwards
     Assert.AreEqual("Terry Brian Jerry Sally ", studentList.DisplayList());
 }