Ejemplo n.º 1
0
        public void TestRangeOperations()
        {
            BList <int> blist  = NewList();
            var         primes = new int[] { 2, 3, 5, 7, 11, 13, 17, 23 };

            blist.AddRange(new int[] { });
            blist.AddRange(primes);
            blist.AddRange(new int[] { });
            ExpectList(blist, primes);

            Assert.AreEqual(4, blist.AddRange(new int[] { 9, 9, 29, 9 }));
            ExpectList(blist, 2, 3, 5, 7, 9, 9, 9, 11, 13, 17, 23, 29);

            Assert.AreEqual(2, blist.RemoveRange(new int[] { 9, 9 }));
            ExpectList(blist, 2, 3, 5, 7, 9, 11, 13, 17, 23, 29);

            Assert.AreEqual(2, blist.RemoveRange(new int[] { 9, 9, 29, 9 }));
            ExpectList(blist, 2, 3, 5, 7, 11, 13, 17, 23);
        }