public void InsertFirstTwoValues_Expect_CountEqualTwo() { var linkedList = new WsLinkedList(); linkedList.InsertFirst(2); linkedList.InsertFirst(3); Assert.Equal(2, linkedList.Count); }
public void InsertFirstTwoValues_Expect_LastEqualHead_FirstEqualTail() { var linkedList = new WsLinkedList(); linkedList.InsertFirst(2); linkedList.InsertFirst(3); Assert.Equal(2, linkedList.Tail.Value); Assert.Equal(3, linkedList.Head.Value); }
public void InsertNodeBeforeInMiddle_Expect_CorrectCount() { var linkedList = new WsLinkedList(); linkedList.InsertFirst(2); linkedList.InsertFirst(3); linkedList.InsertBefore(2, 1); Assert.Equal(3, linkedList.Count); }
public void InsertThree_Expect_FindThree() { var linkedList = new WsLinkedList(); linkedList.InsertFirst(2); linkedList.InsertFirst(3); var valueFound = linkedList.Find(3); Assert.NotNull(valueFound); Assert.Equal(3, valueFound.Value); }
public void InsertNodeBeforeInMiddle_Expect_OrderPersisted() { var linkedList = new WsLinkedList(); linkedList.InsertFirst(2); linkedList.InsertFirst(3); linkedList.InsertBefore(2, 1); var arr = linkedList.ToArray(); Assert.Equal(3, arr[0]); Assert.Equal(1, arr[1]); Assert.Equal(2, arr[2]); }
public void InsertFirst_Expect_EqualHead() { var linkedList = new WsLinkedList(); linkedList.InsertFirst(2); Assert.NotNull(linkedList.Head); Assert.Equal(2, linkedList.Head.Value); }
public void LinkedListToArray_Expect_AllValuesIncluded() { var linkedList = new WsLinkedList(); linkedList.InsertLast(2); linkedList.InsertLast(3); linkedList.InsertFirst(6); var arr = linkedList.ToArray(); Assert.Equal(6, arr[0]); Assert.Equal(2, arr[1]); Assert.Equal(3, arr[2]); }