mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-21 00:11:44 +02:00
RejectOnMatch (wip)
This commit is contained in:
@@ -14,7 +14,7 @@ namespace WireMock.Net.Tests.Matchers
|
||||
var matcher = new JsonPathMatcher("X");
|
||||
|
||||
// Act
|
||||
string name = matcher.GetName();
|
||||
string name = matcher.Name;
|
||||
|
||||
// Assert
|
||||
Check.That(name).Equals("JsonPathMatcher");
|
||||
@@ -131,5 +131,18 @@ namespace WireMock.Net.Tests.Matchers
|
||||
// Assert
|
||||
Check.That(match).IsEqualTo(1);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void JsonPathMatcher_IsMatch_RejectOnMatch()
|
||||
{
|
||||
// Assign
|
||||
var matcher = new JsonPathMatcher(MatchBehaviour.RejectOnMatch, "$..[?(@.Id == 1)]");
|
||||
|
||||
// Act
|
||||
double match = matcher.IsMatch(JObject.Parse("{\"Id\":1,\"Name\":\"Test\"}"));
|
||||
|
||||
// Assert
|
||||
Check.That(match).IsEqualTo(0.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user