public void RemoveHeadTest() { //also a test of the DisplayList method linkedList.AddHead('a'); //tail linkedList.AddHead('b'); linkedList.AddHead('c'); linkedList.AddHead('d'); //head int preSize = linkedList.Size; char removedValue = linkedList.RemoveHead(); int postSize = linkedList.Size; //prints backwards Assert.AreEqual('d', removedValue); Assert.AreEqual("c b a ", linkedList.DisplayList()); Assert.AreEqual(preSize, (postSize + 1)); }
public void RemoveHeadTest() { //also a test of the DisplayList method studentList.AddHead(studentA); //tail studentList.AddHead(studentB); studentList.AddHead(studentC); studentList.AddHead(studentD); //head int preSize = studentList.Size; Student removedValue = studentList.RemoveHead(); int postSize = studentList.Size; //prints backwards Assert.AreEqual(studentD, removedValue); Assert.AreEqual("Brian Jerry Sally ", studentList.DisplayList()); Assert.AreEqual(preSize, (postSize + 1)); }