public void InsertElementAtOutOfBoundsPositionThrowsException() { //Arrange var l = new SingleLinkedList <int>(); l.AddLast(1); l.AddLast(2); l.AddLast(3); l.AddLast(4); //Act //Assert Assert.Throws <ArgumentException>(() => l.AddAtPosition(9, 6)); }
public void InsertElementAtLastPosition() { //Arrange var l = new SingleLinkedList <int>(); l.AddLast(1); l.AddLast(2); l.AddLast(3); l.AddLast(4); //Act l.AddAtPosition(9, 5); //Assert Assert.AreEqual(l.Contains(9), true); Assert.AreEqual(l.GetElementPosition(9), 5); }