Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #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);
 }
Beispiel #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);
 }