Beispiel #1
0
        public void RemoveMany()
        {
            var bag1 = new Bag <string>(StringComparer.InvariantCultureIgnoreCase)
            {
                "foo", "Eric", "Clapton", null, "Foo", "fudd", "elmer"
            };

            string[] s_array = { "FOO", "jasmine", "eric", null };
            int      count   = bag1.RemoveMany(s_array);

            Assert.AreEqual(3, count);

            InterfaceTests.TestReadWriteCollectionGeneric(bag1, new[] { "Clapton", "elmer", "foo", "fudd" }, false);

            bag1.Clear();
            bag1.Add("foo");
            bag1.Add("Eric");
            bag1.Add("Clapton");
            bag1.Add(null);
            bag1.Add("Foo");
            count = bag1.RemoveMany(bag1);
            Assert.AreEqual(5, count);
            Assert.AreEqual(0, bag1.Count);
        }