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."); }
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."); }