public void TestRemoveBeforeDataPresentItemBeforeNotPresent() { int[] intArray = { 1, 2, 3 }; MyLL <int> ll = new MyLL <int>(intArray); ll.RemoveBefore(1); }
public void TestRemoveAfterDataPresentItemAfterNotPresent() { int[] intArray = { 1, 2, 3 }; MyLL <int> ll = new MyLL <int>(intArray); ll.RemoveAfter(3); }
public void TestAddBeforeDataNotPresent() { int[] intArray = { 1, 2, 3 }; MyLL <int> ll = new MyLL <int>(intArray); ll.AddBefore(4, 2); }
public void TestDeleteIndexOutOfRangePositive() { int[] intArray = { 1, 2, 3 }; MyLL <int> ll = new MyLL <int>(intArray); ll.DeleteIndex(3); }
public void TestNodeDataLinkedListValue() { MyLL <int> llinner = new MyLL <int>(1); MyLL <MyLL <int> > llouter = new MyLL <MyLL <int> >(llinner); var actual = llouter.GetHeadData(); Assert.IsInstanceOfType(actual, llinner.GetType()); }
public void TestToStringOverrideEmptyList() { MyLL <int> ll = new MyLL <int>(); var expect = ""; var actual = ll.ToString(); Assert.AreEqual(expect, actual); }
public void TestPopEndNonEmptyList() { int[] intArray = { 1, 2, 3 }; MyLL <int> ll = new MyLL <int>(intArray); var expect = 3; var actual = ll.PopEnd(); Assert.AreEqual(expect, actual); }
public void TestGetSizeEmptyList() { // Doubles as test of Empty Constructor MyLL <int> ll = new MyLL <int>(); var expect = (int)0; var actual = ll.GetSize(); 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 TestGetSizeMultipleNodeList() { // Doubles as test of Multiple Data Constructor int[] intArray = { 1, 2, 3 }; MyLL <int> ll = new MyLL <int>(intArray); var expect = (int)3; var actual = ll.GetSize(); 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 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 TestAppendEmptyToEmpty() { MyLL <int> lla = new MyLL <int>(); MyLL <int> llb = new MyLL <int>(); lla.Append(llb); var expect = 0; var actual = lla.GetSize(); Assert.AreEqual(expect, actual); }
public void TestGetSizeOneNodeList() { // Doubles as test of Single Data Constructor MyLL <int> ll = new MyLL <int>(3); var expect = (int)1; var actual = ll.GetSize(); Assert.AreEqual(expect, actual); // CAUTION: Head and Tail of 1 node list should be the same node, not just equivalent value Assert.AreEqual(ll.GetHeadData(), ll.GetTailData()); }
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 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 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 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); }
public void TestGetTailDataNullValue() { MyLL <string> ll = new MyLL <string>(); var errata = ll.GetTailData(); }
public void TestPopEndEmptyList() { MyLL <int> ll = new MyLL <int>(); var errata = ll.PopEnd(); }