public void LastIndexTest() { ICollection arr = GetList(); int expected = 3; int actual; actual = ICollectionExt.LastIndex(arr); EAssert.AreEqual(expected, actual); }
public void RemoveRangeTest() { ICollection <int> coll = GetList(); IEnumerable <int> items = new List <int> { 1, 3 }; IEnumerable <int> expected = new List <int> { 2, 4 }; ICollectionExt.RemoveRange <int>(coll, items); EAssert.AreEqual(coll, expected); }
public void CutTest() { List <int> coll = GetList(); Func <int, bool> predicate = (int i) => (i > 1); List <int> expected = new List <int>() { 2, 3, 4 }; List <int> actual; actual = ICollectionExt.Cut <int>(coll, predicate); EAssert.AreEqual(actual, expected); EAssert.AreEqual(coll.Count, 1); }