Update QueryStringParser to support param with equal but no value (#1253)

* RequestMessageParamMatcher

* ?

* .

* .
This commit is contained in:
Stef Heyenrath authored and GitHub committed 2025-02-13 18:09:18 +01:00
1 parent 84e5ba6dce
commit f977b3eb86
4 files changed
+42 -22

No files matched your search

@@ -43,6 +43,21 @@ public class RequestMessageParamMatcherTests
Check.That(score).IsEqualTo(0.5d);
}
[Fact]
public void RequestMessageParamMatcher_GetMatchingScore_KeyWithNoValuePresentInUrl_Returns1_0()
{
// Assign
var requestMessage = new RequestMessage(new UrlDetails("http://localhost?key="), "GET", "127.0.0.1");
var matcher = new RequestMessageParamMatcher(MatchBehaviour.AcceptOnMatch, "key", false, "");
// Act
var result = new RequestMatchResult();
var score = matcher.GetMatchingScore(requestMessage, result);
// Assert
Check.That(score).IsEqualTo(1.0d);
}
[Fact]
public void RequestMessageParamMatcher_GetMatchingScore_KeyWith3ValuesPresentInUrl_And_With1ExactStringWith2Patterns_Returns0_66()
{