private static IEnumerable <DiffItem> CompareChildren(string jsonPath, IEnumerable <string> lhsKeys, IEnumerable <string> rhsKeys, IDictionary <string, JToken> lhsElements, IDictionary <string, JToken> rhsElements, ITokenSelectorProvider idProvider) { foreach ((string lhsKey, string rhsKey) in lhsKeys.JoinWithNulls(rhsKeys)) { if (lhsKey == null) { yield return(new DiffItem(JsonPathFormatter.AddToken(jsonPath, rhsKey), rhsElements[rhsKey])); } else if (rhsKey == null) { yield return(new DiffItem(JsonPathFormatter.AddToken(jsonPath, lhsKey), null)); } else { foreach (var diff in Compare(lhsElements[lhsKey], rhsElements[rhsKey], JsonPathFormatter.AddToken(jsonPath, lhsKey), idProvider)) { yield return(diff); } } } }
public string AddTokenTest(string current, string token) { return(JsonPathFormatter.AddToken(current, token)); }