mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-25 10:19:04 +02:00
Write logging in case a Matcher throws an exception (#986)
* ThrowException * ... * . * ... * b * fix test * ... * . * sonar * ft * . * fix tst
This commit is contained in:
@@ -42,7 +42,7 @@ public class JmesPathMatcherTests
|
||||
var matcher = new JmesPathMatcher("");
|
||||
|
||||
// Act
|
||||
double match = matcher.IsMatch(bytes);
|
||||
double match = matcher.IsMatch(bytes).Score;
|
||||
|
||||
// Assert
|
||||
Check.That(match).IsEqualTo(0);
|
||||
@@ -56,7 +56,7 @@ public class JmesPathMatcherTests
|
||||
var matcher = new JmesPathMatcher("");
|
||||
|
||||
// Act
|
||||
double match = matcher.IsMatch(s);
|
||||
double match = matcher.IsMatch(s).Score;
|
||||
|
||||
// Assert
|
||||
Check.That(match).IsEqualTo(0);
|
||||
@@ -70,7 +70,7 @@ public class JmesPathMatcherTests
|
||||
var matcher = new JmesPathMatcher("");
|
||||
|
||||
// Act
|
||||
double match = matcher.IsMatch(o);
|
||||
double match = matcher.IsMatch(o).Score;
|
||||
|
||||
// Assert
|
||||
Check.That(match).IsEqualTo(0);
|
||||
@@ -83,7 +83,7 @@ public class JmesPathMatcherTests
|
||||
var matcher = new JmesPathMatcher("xxx");
|
||||
|
||||
// Act
|
||||
double match = matcher.IsMatch("");
|
||||
double match = matcher.IsMatch("").Score;
|
||||
|
||||
// Assert
|
||||
Check.That(match).IsEqualTo(0);
|
||||
@@ -96,7 +96,7 @@ public class JmesPathMatcherTests
|
||||
var matcher = new JmesPathMatcher("");
|
||||
|
||||
// Act
|
||||
double match = matcher.IsMatch("x");
|
||||
double match = matcher.IsMatch("x").Score;
|
||||
|
||||
// Assert
|
||||
Check.That(match).IsEqualTo(0);
|
||||
@@ -109,7 +109,7 @@ public class JmesPathMatcherTests
|
||||
var matcher = new JmesPathMatcher("things.name == 'RequiredThing'");
|
||||
|
||||
// Act
|
||||
double match = matcher.IsMatch(new { things = new { name = "RequiredThing" } });
|
||||
double match = matcher.IsMatch(new { things = new { name = "RequiredThing" } }).Score;
|
||||
|
||||
// Assert
|
||||
Check.That(match).IsEqualTo(1);
|
||||
@@ -132,7 +132,7 @@ public class JmesPathMatcherTests
|
||||
{ "Id", new JValue(1) },
|
||||
{ "things", sub }
|
||||
};
|
||||
double match = matcher.IsMatch(jobject);
|
||||
double match = matcher.IsMatch(jobject).Score;
|
||||
|
||||
// Assert
|
||||
Check.That(match).IsEqualTo(1);
|
||||
@@ -145,7 +145,7 @@ public class JmesPathMatcherTests
|
||||
var matcher = new JmesPathMatcher("things.x == 'RequiredThing'");
|
||||
|
||||
// Act
|
||||
double match = matcher.IsMatch(JObject.Parse("{ \"things\": { \"x\": \"RequiredThing\" } }"));
|
||||
double match = matcher.IsMatch(JObject.Parse("{ \"things\": { \"x\": \"RequiredThing\" } }")).Score;
|
||||
|
||||
// Assert
|
||||
Check.That(match).IsEqualTo(1);
|
||||
@@ -155,10 +155,10 @@ public class JmesPathMatcherTests
|
||||
public void JmesPathMatcher_IsMatch_RejectOnMatch()
|
||||
{
|
||||
// Assign
|
||||
var matcher = new JmesPathMatcher(MatchBehaviour.RejectOnMatch, false, MatchOperator.Or, "things.x == 'RequiredThing'");
|
||||
var matcher = new JmesPathMatcher(MatchBehaviour.RejectOnMatch, MatchOperator.Or, "things.x == 'RequiredThing'");
|
||||
|
||||
// Act
|
||||
double match = matcher.IsMatch(JObject.Parse("{ \"things\": { \"x\": \"RequiredThing\" } }"));
|
||||
double match = matcher.IsMatch(JObject.Parse("{ \"things\": { \"x\": \"RequiredThing\" } }")).Score;
|
||||
|
||||
// Assert
|
||||
Check.That(match).IsEqualTo(0.0);
|
||||
|
||||
Reference in New Issue
Block a user