public void TestToStringOverrideEmptyList() { MyLL <int> ll = new MyLL <int>(); var expect = ""; var actual = ll.ToString(); Assert.AreEqual(expect, actual); }
public void TestToStringOverride() { int[] intArray = { 1, 2, 3 }; MyLL <int> ll = new MyLL <int>(intArray); var expect = "1, 2, 3"; var actual = ll.ToString(); Assert.AreEqual(expect, actual); }
public void TestAddAtEndToEmptyList() { MyLL <int> ll = new MyLL <int>(); var expect = "1"; ll.AddAtEnd(1); var actual = ll.ToString(); Assert.AreEqual(expect, actual); }
public void TestAddAtFrontToNonEmptyList() { MyLL <int> ll = new MyLL <int>(1); var expect = "2, 1"; ll.AddAtFront(2); var actual = ll.ToString(); Assert.AreEqual(expect, actual); }
public void TestRemoveBeforeDataPresentItemBeforePresentFirstItem() { int[] intArray = { 1, 2, 3 }; MyLL <int> ll = new MyLL <int>(intArray); ll.RemoveBefore(2); var expect = "2, 3"; var actual = ll.ToString(); Assert.AreEqual(expect, actual); }
public void TestRemoveAfterDataPresentItemAfterPresentLastItem() { int[] intArray = { 1, 2, 3 }; MyLL <int> ll = new MyLL <int>(intArray); ll.RemoveAfter(2); var expect = "1, 2"; var actual = ll.ToString(); Assert.AreEqual(expect, actual); }
public void TestDeleteIndexPresent() { int[] intArray = { 1, 2, 3 }; MyLL <int> ll = new MyLL <int>(intArray); ll.DeleteIndex(1); var expect = "1, 3"; var actual = ll.ToString(); Assert.AreEqual(expect, actual); }
public void TestAppendNonEmptyToEmpty() { MyLL <int> lla = new MyLL <int>(1); MyLL <int> llb = new MyLL <int>(); lla.Append(llb); var expect = "1"; var actual = lla.ToString(); Assert.AreEqual(expect, actual); }
public void TestAddBeforeDataPresent() { int[] intArray = { 1, 2, 3 }; MyLL <int> ll = new MyLL <int>(intArray); ll.AddBefore(2, 4); var expect = "1, 4, 2, 3"; var actual = ll.ToString(); Assert.AreEqual(expect, actual); }
public void TestAppendNonEmptyToNonEmpty() { int[] intsA = { 1, 2 }; int[] intsB = { 3, 4 }; MyLL <int> lla = new MyLL <int>(intsA); MyLL <int> llb = new MyLL <int>(intsB); lla.Append(llb); var expect = "1, 2, 3, 4"; var actual = lla.ToString(); Assert.AreEqual(expect, actual); }