-
-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Requests with querystrings don't seem to be matched properly.
Created a repro test case, which fails:
[Fact]
public void GivenRouteWithParameterAndQueryStringUsingTheBuilder_RequestBuilderIsReturned()
{
var requestBuilder = (RequestBuilder)new RequestBuilder().Get().ForUrl("/api/foos/{id}").WithQueryStringParameter("blah").HavingAnyValue();
var routes = new List<RequestBuilder>
{
requestBuilder,
};
var dictionary = ConfiguredRequests.FromRequestBuilders(routes);
dictionary
.Match(
HttpMethod.Get,
"/api/foos/1234?blah=baz",
null)
.Should()
.Be(requestBuilder);
}
I don't have a fix for this yet, but working on it.
Looks like it fails in the matching, because the query string like this is not added to the _queryParameters in the RequestQueryNode. Therefore the count matching fails, therefore doesn't return it.
When using the old api for the builder, it does work, so using:
_testableMessageHandler.RespondTo(HttpMethod.Get, "/api/foos/{id}").WithQueryStringParameter("blah").HavingAnyValue()
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels