public void LinkedHashSet_Generic_RemoveWhere_AllElements(int setLength) { LinkedHashSet <T> set = (LinkedHashSet <T>)GenericISetFactory(setLength); int removedCount = set.RemoveWhere((value) => { return(true); }); Assert.Equal(setLength, removedCount); }
public void LinkedHashSet_Generic_RemoveWhere_NewObject() // Regression Dev10_624201 { object[] array = new object[2]; object obj = new object(); LinkedHashSet <object> set = new LinkedHashSet <object>(); set.Add(obj); set.Remove(obj); foreach (object o in set) { } set.CopyTo(array, 0, 2); set.RemoveWhere((element) => { return(false); }); }
public void LinkedHashSet_Generic_RemoveWhere_NullMatchPredicate(int setLength) { LinkedHashSet <T> set = (LinkedHashSet <T>)GenericISetFactory(setLength); Assert.Throws <ArgumentNullException>(() => set.RemoveWhere(null)); }