public void ToStringOnSingleItemList() { SinglyLinkedList list = new SinglyLinkedList(); list.AddLast("foo"); Assert.AreEqual("{ \"foo\" }", list.ToString()); }
public void ToStringOnEmptyList() { SinglyLinkedList list = new SinglyLinkedList(); Assert.AreEqual("{ }", list.ToString()); }
public void ToStringOnMultipleItemList() { SinglyLinkedList list = new SinglyLinkedList(); list.AddLast("foo"); list.AddLast("bar"); list.AddLast("grille"); Assert.AreEqual("{ \"foo\", \"bar\", \"grille\" }", list.ToString()); }
public void ToStringWithInt() { SinglyLinkedList<int> list = new SinglyLinkedList<int>(new int[] { 1, 2, 3, 4 }); string expected = "{ \"1\", \"2\", \"3\", \"4\" }"; Assert.AreEqual(expected, list.ToString()); }