public void GetTheLastElementInEmptyList_OutOfRangeException() { DoublyLinkedList <string> testList = new DoublyLinkedList <string>(); Assert.ThrowsException <IndexOutOfRangeException>( () => testList.LastElement()); }
public void GetTheLastElement_TheRightElementIsGotten() { string expected = "5"; DoublyLinkedList <string> testList = new DoublyLinkedList <string>("1", "2", "3", "4", "5"); string actual = testList.LastElement(); Xunit.Assert.Equal(expected, actual); }
public void GetTheLastElement_TheRightElementIsGotten() { string expected = "5"; DoublyLinkedList <string> testList = new DoublyLinkedList <string>(); testList.AddToTail("1"); testList.AddToTail("2"); testList.AddToTail("3"); testList.AddToTail("4"); testList.AddToTail("5"); string actual = testList.LastElement(); Assert.AreEqual(expected, actual); }