Beispiel #1
0
 public void TestRemove_MultipleOccurrences_RemovesFirstOccurrence()
 {
     var list = new TypedList<ArrayList, int>(new ArrayList() { 0, 1, 0, 1 });
     bool result = list.Remove(1);
     Assert.IsTrue(result, "The value was not found.");
     int[] expected = { 0, 0, 1 };
     int[] actual = toTypedArray(list.List);
     Assert.IsTrue(expected.ToSublist().IsEqualTo(actual.ToSublist()), "The item was not removed from the list.");
 }
Beispiel #2
0
 public void TestRemove_ValueNotFound_ReturnsFalse()
 {
     var list = new TypedList<ArrayList, int>(new ArrayList() { 0, 1, 2 });
     bool result = list.Remove(3);
     Assert.IsFalse(result);
 }
Beispiel #3
0
 public void TestRemove_FindsValue_ReturnsTrue()
 {
     var list = new TypedList<ArrayList, int>(new ArrayList() { 0, 1, 2 });
     bool result = list.Remove(0);
     Assert.IsTrue(result, "The value was not found.");
     int[] expected = { 1, 2, };
     int[] actual = toTypedArray(list.List);
     Assert.IsTrue(expected.ToSublist().IsEqualTo(actual.ToSublist()), "The item was not removed from the list.");
 }