示例#1
0
 public void Remove_NullKey_ThrowsArgumentNullException()
 {
     JsonObject obj = new JsonObject();
     Assert.Throws<ArgumentNullException>("key", () => obj.Remove(null));
 }
示例#2
0
        public void Remove()
        {
            KeyValuePair<string, JsonValue> item = new KeyValuePair<string, JsonValue>("key", new JsonPrimitive(true));
            JsonObject obj = new JsonObject(item);

            obj.Remove(item.Key);
            Assert.Equal(0, obj.Count);
            Assert.False(obj.ContainsKey(item.Key));

            obj.Remove(item.Key);
            Assert.Equal(0, obj.Count);
        }