Пример #1
0
        public void RemoveAt_InvalidIndex_ThrowsArgumentOutOfRangeException()
        {
            JsonArray array = new JsonArray(new JsonPrimitive(true));

            Assert.Throws<ArgumentOutOfRangeException>("index", () => array.RemoveAt(-1));
            Assert.Throws<ArgumentOutOfRangeException>("index", () => array.RemoveAt(1));
        }
Пример #2
0
        public void RemoveAt()
        {
            JsonValue[] items = new JsonValue[] { new JsonPrimitive(true) };
            JsonArray array = new JsonArray((IEnumerable<JsonValue>)items);

            array.RemoveAt(0);
            Assert.Equal(0, array.Count);
        }