public void Can_Add_After() { var myLinkedList = new MyLinkedList <int>(); myLinkedList.AddFirst(1); myLinkedList.AddLast(2); myLinkedList.AddLast(4); myLinkedList.AddAfter(myLinkedList.GetHead().Next, 3); myLinkedList.GetHead().Next.Next.Data.Should().Be(3); }
public void Can_Add_Before() { var myLinkedList = new MyLinkedList <int>(); myLinkedList.AddFirst(1); myLinkedList.AddLast(3); myLinkedList.AddLast(4); myLinkedList.AddBefore(myLinkedList.GetHead().Next, 2); myLinkedList.GetHead().Next.Data.Should().Be(2); }
public void Can_Add_First() { var myLinkedList = new MyLinkedList <int>(); myLinkedList.AddFirst(1); myLinkedList.GetHead().Data.Should().Be(1); }