hibri / HttpMock

A library for creating Http servers on the fly in tests and stubbing responses
MIT License
128 stars 44 forks source link

Duplicate params in query string #49

Closed neoistheone123 closed 8 years ago

neoistheone123 commented 8 years ago

WithParams doesn't support dup query params. I couldn't find a workaround.

In QueryParamMatch, there is... if (!String.Equals(requestQueryParams[queryParam.Key], queryParam.Value, StringComparison.OrdinalIgnoreCase)) { return false; }

Could you please change it such that it uses requestQueryParams.Values given a key? That way, it can support dup query params polymorphically.

In EndpointMatchingRule, var requestQueryParams = valueCollection.AllKeys .Where(k => !string.IsNullOrEmpty(k)) .ToDictionary(k => k, k => valueCollection[k]);

This seems to ignore dup query params when it does ToDictionary.