Exemplo n.º 1
0
        public void EvaluateArrayOutOfBoundsIndxerWithError()
        {
            var a = JsonDocument.Parse("[1,2,3,4,5]").RootElement;

            ExceptionAssert.Throws <JsonException>(() => { a.SelectElement("[1000].Ha", true); }, "Index 1000 outside the bounds of JArray.");
        }
Exemplo n.º 2
0
        public void EvaluateMultiPropertyIndexOnArrayWithError()
        {
            var a = JsonDocument.Parse("[1,2,3,4,5]").RootElement;

            ExceptionAssert.Throws <JsonException>(() => { a.SelectElement("['Missing','Missing2']", true); }, "Properties 'Missing', 'Missing2' not valid on JsonElement.");
        }