Exemplo n.º 1
0
        public void LastIndexTest()
        {
            ICollection arr      = GetList();
            int         expected = 3;
            int         actual;

            actual = ICollectionExt.LastIndex(arr);
            EAssert.AreEqual(expected, actual);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }