public void Remove_NullKey_ThrowsArgumentNullException() { JsonObject obj = new JsonObject(); Assert.Throws<ArgumentNullException>("key", () => obj.Remove(null)); }
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); }