Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }