JmesPathMatcherTests (#998)

This commit is contained in:
Stef Heyenrath
2023-09-27 21:42:34 +02:00
committed by GitHub
parent b63076a9ac
commit 9f9fc85a64
3 changed files with 79 additions and 2 deletions

View File

@@ -118,8 +118,9 @@ public class JsonPathMatcher : IStringMatcher, IObjectMatcher
// The SelectToken method can accept a string path to a child token ( i.e. "Manufacturers[0].Products[0].Price").
// In that case it will return a JValue (some type) which does not implement the IEnumerable interface.
return MatchScores.ToScore(
_patterns.Select(pattern => array.SelectToken(pattern.GetPattern()) != null).ToArray(), MatchOperator);
var values = _patterns.Select(pattern => array.SelectToken(pattern.GetPattern()) != null).ToArray();
return MatchScores.ToScore(values, MatchOperator);
}
// https://github.com/WireMock-Net/WireMock.Net/issues/965