public void RemoveLast() { var list = new LALinkedList <string>(); list.AddLast("John"); list.AddLast("Fred"); list.RemoveLast(); Assert.AreEqual("John", list.First.Value); Assert.AreEqual("John", list.Last.Value); Assert.AreEqual(1, list.Count); }
public void Enumeration_IsNeverNull() { var list = new LALinkedList <object>(); foreach (object o in list) { Assert.IsNotNull(o); } list.AddLast(new object()); list.AddLast(new object()); list.AddLast(new object()); foreach (object o in list) { Assert.IsNotNull(o); } list.RemoveLast(); foreach (object o in list) { Assert.IsNotNull(o); } list.RemoveFirst(); foreach (object o in list) { Assert.IsNotNull(o); } list.Clear(); foreach (object o in list) { Assert.IsNotNull(o); } }