Example #1
0
        public void HashSet_Generic_RemoveWhere_AllElements(int setLength)
        {
            PooledSet <T> set          = (PooledSet <T>)GenericISetFactory(setLength);
            int           removedCount = set.RemoveWhere((value) => { return(true); });

            Assert.Equal(setLength, removedCount);
        }
Example #2
0
        public void HashSet_Generic_RemoveWhere_NewObject(int setLength) // Regression Dev10_624201
        {
            object[]           array = new object[2];
            object             obj   = new object();
            PooledSet <object> set   = new PooledSet <object>();

            RegisterForDispose(set);

            set.Add(obj);
            set.Remove(obj);
            foreach (object o in set)
            {
            }
            set.CopyTo(array, 0, 2);
            set.RemoveWhere((element) => { return(false); });
        }
Example #3
0
        public void HashSet_Generic_RemoveWhere_NullMatchPredicate(int setLength)
        {
            PooledSet <T> set = (PooledSet <T>)GenericISetFactory(setLength);

            Assert.Throws <ArgumentNullException>(() => set.RemoveWhere(null));
        }