public void AddBefore(int oldItem, int item) { for (int i = 1; i <= 5; i++) { circularSinglyLinkedList.AddLast(i); } circularSinglyLinkedList.AddBefore(oldItem, item); Assert.AreEqual(circularSinglyLinkedList.Count(), 6, "invalid count"); Assert.IsTrue(circularSinglyLinkedList.Contains(item), "Item doesn't exists."); }
public void AddNullItem() { var list = new CircularSinglyLinkedList <string>(); list.AddFirst(null); list.AddLast(null); list.AddAfter(null, null); list.AddBefore(null, null); Assert.AreEqual(list.Count(), 4, "invalid count"); list.Remove(null); list.RemoveFirst(); list.RemoveLast(); Assert.AreEqual(list.Count(), 1, "invalid count"); }