fix: support generic type in additional interfaces#475
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves support for generic types in generated “additional interfaces” mock extensions and tightens up HTTP content/form-data matching behavior through updated tests and parsing.
Changes:
- Add coverage for matching when a parameter also implements
IHttpRequestMessagePropertyParameter<HttpContent?>. - Adjust multipart form-data extraction to preserve line endings/whitespace as read.
- Sanitize generated extension names to handle generic type names (angle brackets).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| Tests/Mockolate.Tests/Web/ItExtensionsTests.IsHttpContentTests.WithFormDataTests.cs | Adds an additional form-data test case for exact parameter matching. |
| Tests/Mockolate.Internal.Tests/WebTests.cs | Adds test coverage for the “prefer IHttpRequestMessagePropertyParameter<T> match” path. |
| Source/Mockolate/Web/ItExtensions.HttpContent.WithFormData.cs | Changes normalization in multipart form-data extraction (no longer trims line endings). |
| Source/Mockolate.SourceGenerators/Sources/Sources.ForMock.CombinationExtensions.cs | Updates generated name sanitization to account for generic type syntax. |
Test Results 21 files ± 0 21 suites ±0 5m 16s ⏱️ - 1m 58s Results for commit ef10589. ± Comparison against base commit c7f0b1b. This pull request removes 1 and adds 2 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
🚀 Benchmark ResultsDetails
|
|
|
This is addressed in release v1.4.1. |

This PR improves support for generic types in generated “additional interfaces” mock extensions and tightens up HTTP content/form-data matching behavior through updated tests and parsing.
Key Changes:
IHttpRequestMessagePropertyParameter<HttpContent?>.