public void RemoveKeys() { var dictionary = new SynchronizedDictionary <string, string>(); var collection = new[] { new KeyValuePair <string, string>("22", "33"), new KeyValuePair <string, string>("44", "55"), new KeyValuePair <string, string>("66", "77"), }; dictionary.AddRange(collection); Assert.Equal(dictionary.Count, collection.Count()); dictionary.RemoveKeys(collection.Select(t => t.Key)); Assert.Equal(0, dictionary.Count()); }
public void RemoveKeys() { var dictionary = new SynchronizedDictionary<string, string>(); var collection = new[] { new KeyValuePair<string, string>("22", "33"), new KeyValuePair<string, string>("44", "55"), new KeyValuePair<string, string>("66", "77"), }; dictionary.AddRange(collection); Assert.Equal(dictionary.Count, collection.Count()); dictionary.RemoveKeys(collection.Select(t => t.Key)); Assert.Equal(0, dictionary.Count()); }