-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Hey,
Thank you for writing this awesome library !
While using it I ran into a fun challenge :)
While mocking a Http Request with RequestURI and QueryString, like this:
_mockHttp = new MockHttpHandler();
_mockHttp.When( matching => matching
.Method("GET")
.RequestUri("https://magic.rest.api.com/awesomepath")
.QueryString("q=name:<name>&sort=desc")
.Respond( with => with
.StatusCode(200)
.Body(<json string>)
.ContentType("application/json"))
.Verifiable();
The request matcher does not match the request even though the InvokedRequest and the Matcher URI and QueryString, combined is a perfect match.
To make the request work, I need to add '*' at the end of the URI, like this:
....
.Method("GET")
.RequestUri("https://magic.rest.api.com/awesomepath*")
.QueryString("q=name:<name>&sort=desc")
....
When I looked through the code, here:
| public static RequestMatching RequestUri(this RequestMatching builder, string requestUri) |
I'll be happy to give it a try and create a PR with a fix if this is not intended behaviour.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels