public void PathWithSlice_ReturnsExpectedResult(string path, string expectedJson) { expectedJson = expectedJson.Replace("`", "\""); string json = TestDataLoader.AbcArray(); IReadOnlyList <JsonElement> result = JsonPath.ExecutePath(path, json); string resultJson = JsonSerializer.Serialize(result); Assert.Equal(expectedJson, resultJson); }
public void PathWithAllElements_ReturnsExpectedResult() { string path = "[*]"; string json = TestDataLoader.AbcArray(); IReadOnlyList <JsonElement> result = JsonPath.ExecutePath(path, json); string resultJson = JsonSerializer.Serialize(result); json = new string(json.Where(x => !char.IsWhiteSpace(x)).ToArray()); Assert.Equal(json, resultJson); }