示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }
示例#4
0
 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);
 }
示例#5
0
 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);
 }