public void AddToEndTest() { GenericLinkedList<int> list = new GenericLinkedList<int>(); list.AddToEnd(1); list.AddToEnd(2); string result = list.ToString(); Assert.AreNotEqual(string.Empty, result); Assert.AreEqual("1, 2", result); }
public void AddToEndTest() { GenericLinkedList <int> list = new GenericLinkedList <int>(); list.AddToEnd(1); list.AddToEnd(2); string result = list.ToString(); Assert.AreNotEqual(string.Empty, result); Assert.AreEqual("1, 2", result); }
public void ReadAtTest() { GenericLinkedList<int> list = new GenericLinkedList<int>(); list.AddToEnd(1); list.AddToEnd(2); list.AddToEnd(3); string output = list.ToString(); Assert.AreNotEqual(string.Empty, output); Assert.AreEqual("1, 2, 3", output); int result = list.ReadAt(2); Assert.AreEqual(2, result); }
public void ReadAtTest() { GenericLinkedList <int> list = new GenericLinkedList <int>(); list.AddToEnd(1); list.AddToEnd(2); list.AddToEnd(3); string output = list.ToString(); Assert.AreNotEqual(string.Empty, output); Assert.AreEqual("1, 2, 3", output); int result = list.ReadAt(2); Assert.AreEqual(2, result); }
public void RemoveAtFirstWhenThereIsOneNodeTest() { GenericLinkedList <int> list = new GenericLinkedList <int>(); list.AddToEnd(1); string result = list.ToString(); Assert.AreNotEqual(string.Empty, result); Assert.AreEqual("1", result); list.RemoveAt(1); result = list.ToString(); Assert.AreEqual(string.Empty, result); }
public void Push(T item) { list.AddToEnd(item); }
public void RemoveAtFirstWhenThereIsOneNodeTest() { GenericLinkedList<int> list = new GenericLinkedList<int>(); list.AddToEnd(1); string result = list.ToString(); Assert.AreNotEqual(string.Empty, result); Assert.AreEqual("1", result); list.RemoveAt(1); result = list.ToString(); Assert.AreEqual(string.Empty, result); }