Beispiel #1
0
 public void TestRemoveAt_NegativeIndex_Throws()
 {
     var list = new TypedList<ArrayList, int>(new ArrayList() { 1, 2, 3 });
     list.RemoveAt(-1);
 }
Beispiel #2
0
 public void TestRemoveAt_IndexInMiddle_RemovesFromMiddle()
 {
     var list = new TypedList<ArrayList, int>(new ArrayList() { 1, 2, 3, 4 });
     list.RemoveAt(2);
     int[] expected = { 1, 2, 4 };
     int[] actual = toTypedArray(list.List);
     Assert.IsTrue(expected.ToSublist().IsEqualTo(actual.ToSublist()), "The item was not removed as expected.");
 }
Beispiel #3
0
 public void TestRemoveAt_IndexTooBig_Throws()
 {
     var list = new TypedList<ArrayList, int>(new ArrayList() { 1, 2, 3 });
     list.RemoveAt(3);
 }
Beispiel #4
0
 public void TestRemoveAt_IndexAtBeginning_RemovesFromBack()
 {
     var list = new TypedList<ArrayList, int>(new ArrayList() { 1, 2, 3 });
     list.RemoveAt(0);
     int[] expected = { 2, 3 };
     int[] actual = toTypedArray(list.List);
     Assert.IsTrue(expected.ToSublist().IsEqualTo(actual.ToSublist()), "The item was not removed as expected.");
 }