public void AddRange_NullArray_Works() { JsonArray array = new JsonArray(); array.AddRange(null); Assert.Equal(0, array.Count); }
public void AddRange_NullIEnumerable_ThrowsArgumentNullException() { JsonArray array = new JsonArray(); Assert.Throws<ArgumentNullException>("items", () => array.AddRange((IEnumerable<JsonValue>)null)); }
public void AddRange_IEnumerable() { JsonArray array = new JsonArray(); JsonValue[] values = new JsonValue[] { null, new JsonPrimitive(true) }; array.AddRange((IEnumerable<JsonValue>)values); Assert.Equal(2, array.Count); Assert.Same(values[0], array[0]); Assert.Same(values[1], array[1]); }