public void CanFindOutIfContainsAKey() { WeakRefDictionary <object, object> dict = new WeakRefDictionary <object, object>(); dict.Add("foo", null); Assert.True(dict.ContainsKey("foo")); Assert.False(dict.ContainsKey("foo2")); }
public override bool Contains(object key) { Guard.ArgumentNotNull(key, "key"); if (references.ContainsKey(key)) { return(true); } if (ParentLocator != null) { return(ParentLocator.Contains(key)); } return(false); }