feat: support multiple parameters in WithQuery#460
Conversation
Test Results 21 files ± 0 21 suites ±0 6m 22s ⏱️ +51s Results for commit 2df3636. ± Comparison against base commit c9b806b. This pull request removes 25 and adds 38 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Pull request overview
This PR adds support for multiple query parameters in the WithQuery method, enhancing the URI matching capabilities in Mockolate's web testing utilities. The previous implementation only supported pattern matching against the entire query string, while the new implementation allows precise matching of individual query parameters.
Changes:
- Introduced
HttpQueryParameterValueclass to represent query parameter values - Added multiple overloads of
WithQueryto support single parameters, multiple parameters, and query strings - Reorganized tests into separate files per method for better organization
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| Source/Mockolate/Web/HttpQueryParameterValue.cs | New class for representing HTTP query parameter values with matching logic |
| Source/Mockolate/Web/ItExtensions.Uri.cs | Added three overloads of WithQuery method and updated implementation to use HttpQueryMatcher |
| Source/Mockolate/Web/ItExtensions.cs | Introduced HttpQueryMatcher class for parsing and matching query parameters |
| Tests/Mockolate.Tests/Web/ItExtensionsTests.IsUriTests.cs | Removed test methods and changed class to partial to support test reorganization |
| Tests/Mockolate.Tests/Web/ItExtensionsTests.IsUriTests.WithQueryTests.cs | New test file containing query parameter matching tests |
| Tests/Mockolate.Tests/Web/ItExtensionsTests.IsUriTests.WithPortTests.cs | New test file containing port matching tests |
| Tests/Mockolate.Tests/Web/ItExtensionsTests.IsUriTests.WithPathTests.cs | New test file containing path matching tests |
| Tests/Mockolate.Tests/Web/ItExtensionsTests.IsUriTests.WithHostTests.cs | New test file containing host matching tests |
| Tests/Mockolate.Tests/Web/ItExtensionsTests.IsUriTests.ForHttpsTests.cs | New test file containing HTTP/HTTPS scheme tests |
| Tests/Mockolate.Api.Tests/Expected/Mockolate_netstandard2.0.txt | Updated API surface to reflect new HttpQueryParameterValue class and WithQuery overloads |
| Tests/Mockolate.Api.Tests/Expected/Mockolate_net8.0.txt | Updated API surface for .NET 8.0 target |
| Tests/Mockolate.Api.Tests/Expected/Mockolate_net10.0.txt | Updated API surface for .NET 10.0 target |
d2ecf25 to
59f6cae
Compare
🚀 Benchmark ResultsDetails
|
|
|
This is addressed in release v1.3.0. |



This PR adds support for multiple query parameters in the
WithQuerymethod, enhancing the URI matching capabilities in Mockolate's web testing utilities. The previous implementation only supported pattern matching against the entire query string, while the new implementation allows precise matching of individual query parameters.Key Changes:
HttpQueryParameterValueclass to represent query parameter valuesWithQueryto support single parameters, multiple parameters, and query stringsWithQueryexperience #456