fix: enable validation when using form-data access#474
Conversation
There was a problem hiding this comment.
Pull request overview
Refactors ItExtensions HTTP content/header matching APIs (moving convenience overloads into extension blocks and splitting concerns across new partial files) and strengthens test expectations around WithFormData validation.
Changes:
- Added an invocation verification in the
WithFormData_ShouldMatchParametersInAnyOrdertest. - Moved several
IHttpContentParameter/IHttpHeaderParameterconvenience overloads from interfaces intoextension(...)blocks and introduced helpers/wrappers to support chaining. - Extracted
WithString,WithFormData, andWithByteslogic into dedicated partial files and updated API expectation baselines.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/Mockolate.Tests/Web/ItExtensionsTests.IsHttpContentTests.WithFormDataTests.cs | Adds an explicit verification that PostAsync was invoked with expected WithFormData values. |
| Tests/Mockolate.Api.Tests/Expected/Mockolate_netstandard2.0.txt | Updates expected public API surface to reflect extension-block moved members. |
| Tests/Mockolate.Api.Tests/Expected/Mockolate_net8.0.txt | Updates expected public API surface to reflect extension-block moved members. |
| Tests/Mockolate.Api.Tests/Expected/Mockolate_net10.0.txt | Updates expected public API surface to reflect extension-block moved members. |
| Source/Mockolate/Web/ItExtensions.cs | Adds header parsing helper and restructures IHttpHeaderParameter API with extension-block overloads. |
| Source/Mockolate/Web/ItExtensions.HttpContent.cs | Removes in-file string/form-data helpers, introduces wrapper, and simplifies matchers. |
| Source/Mockolate/Web/ItExtensions.HttpContent.WithString.cs | Reintroduces string-body exact/wildcard/regex matching via wrapper + extension-block APIs. |
| Source/Mockolate/Web/ItExtensions.HttpContent.WithFormData.cs | Reintroduces form-data matching via wrapper + extension-block APIs, including new multipart-stripping parsing. |
| Source/Mockolate/Web/ItExtensions.HttpContent.WithBytes.cs | Reintroduces byte-array equality matching via extension-block API. |
🚀 Benchmark ResultsDetails
|
5d2a47f to
32e0221
Compare
9a0660d to
7067a1e
Compare
7067a1e to
4a16a96
Compare
|
|
This is addressed in release v1.4.1. |



Refactors
ItExtensionsHTTP content/header matching APIs (moving convenience overloads into extension blocks and splitting concerns across new partial files) and strengthens test expectations aroundWithFormDatawhen using setup and validation in one test.Key Changes:
WithFormData_ShouldMatchParametersInAnyOrdertest.IHttpContentParameter/IHttpHeaderParameterconvenience overloads from interfaces intoextension(...)blocks and introduced helpers/wrappers to support chaining.WithString,WithFormData,WithBytes, andWithHeaderslogic into dedicated partial files and updated API expectation baselines.