示例#1
0
 public void AddRange_NullArray_Works()
 {
     JsonArray array = new JsonArray();
     array.AddRange(null);
     Assert.Equal(0, array.Count);
 }
示例#2
0
 public void AddRange_NullIEnumerable_ThrowsArgumentNullException()
 {
     JsonArray array = new JsonArray();
     Assert.Throws<ArgumentNullException>("items", () => array.AddRange((IEnumerable<JsonValue>)null));
 }
示例#3
0
        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]);
        }