public void RemoveExistingViaGenericCollection() { ICollection <KeyValuePair <string, object> > obj = new JsonObject(); obj.Add(new KeyValuePair <string, object>("first", 123)); Assert.AreEqual(1, obj.Count); Assert.IsTrue(obj.Remove(new KeyValuePair <string, object>("first", 123))); Assert.AreEqual(0, obj.Count); }
public void RemoveNonExistingKeyMatchingValueViaGenericCollection() { ICollection <KeyValuePair <string, object> > obj = new JsonObject(); obj.Add(new KeyValuePair <string, object>("first", 123)); Assert.AreEqual(1, obj.Count); Assert.IsFalse(obj.Remove(new KeyValuePair <string, object>("second", 123))); Assert.AreEqual(1, obj.Count); }
public void RemoveNonExistingViaGenericDictionary() { IDictionary <string, object> obj = new JsonObject(); obj.Add("first", 123); Assert.AreEqual(1, obj.Count); Assert.IsFalse(obj.Remove("second")); Assert.AreEqual(1, obj.Count); }
public void RemoveNonExistingViaGenericDictionary() { IDictionary<string, object> obj = new JsonObject(); obj.Add("first", 123); Assert.AreEqual(1, obj.Count); Assert.IsFalse(obj.Remove("second")); Assert.AreEqual(1, obj.Count); }
public void RemoveNonExistingViaGenericCollection() { ICollection<KeyValuePair<string, object>> obj = new JsonObject(); obj.Add(new KeyValuePair<string, object>("first", 123)); Assert.AreEqual(1, obj.Count); Assert.IsFalse(obj.Remove(new KeyValuePair<string, object>("second", 456))); Assert.AreEqual(1, obj.Count); }