Conversation
🚀 Benchmark ResultsDetails
|
There was a problem hiding this comment.
Pull request overview
This PR extends Mockolate’s It.IsHttpContent() matching so multiple body conditions can be combined, and introduces an Exactly() modifier for strict string-body matching.
Changes:
- Allow accumulating multiple
HttpContentbody matchers (AND semantics) instead of overwriting the previous matcher. - Update
WithStringmatching to support.Exactly()for full-body equality and expand tests for new composition scenarios. - Update API snapshot expectations to include the new
Exactly()method.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/Mockolate.Tests/Web/ItExtensionsTests.IsHttpContentTests.WithStringTests.cs | Adds tests for .Exactly() and multiple WithString expectations. |
| Tests/Mockolate.Tests/Web/ItExtensionsTests.IsHttpContentTests.WithStringMatchingTests.cs | Adds tests ensuring multiple WithStringMatching expectations are all verified. |
| Tests/Mockolate.Api.Tests/Expected/Mockolate_netstandard2.0.txt | Updates API snapshot to include IStringContentBodyParameter.Exactly(). |
| Tests/Mockolate.Api.Tests/Expected/Mockolate_net8.0.txt | Updates API snapshot to include IStringContentBodyParameter.Exactly(). |
| Tests/Mockolate.Api.Tests/Expected/Mockolate_net10.0.txt | Updates API snapshot to include IStringContentBodyParameter.Exactly(). |
| Source/Mockolate/Web/ItExtensions.HttpContent.cs | Switches from a single content matcher to a list of matchers and requires all to match. |
| Source/Mockolate/Web/ItExtensions.HttpContent.WithString.cs | Implements substring matching + adds .Exactly() to require full-body equality. |
| Source/Mockolate/Internals/Polyfills/StringExtensions.cs | Adds NETSTANDARD2_0 polyfill for string.Contains(string, StringComparison). |
Tests/Mockolate.Tests/Web/ItExtensionsTests.IsHttpContentTests.WithStringTests.cs
Show resolved
Hide resolved
|
There was a problem hiding this comment.
Pull request overview
Extends Mockolate’s It.IsHttpContent() matching to support composing multiple body predicates (AND semantics) and adds an Exactly() modifier to switch WithString(...) from substring matching to full-body matching.
Changes:
- Accumulate multiple
HttpContentstring-body predicates and require all to match. - Add
Exactly()to the string-body matcher API and expand tests for strict vs non-strict matching and multi-expectation composition. - Update API snapshot expectations for the new
Exactly()method.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/Mockolate.Tests/Web/ItExtensionsTests.IsHttpContentTests.WithStringTests.cs | Adds tests for Exactly() and composed string expectations; updates existing WithString expectations. |
| Tests/Mockolate.Tests/Web/ItExtensionsTests.IsHttpContentTests.WithStringMatchingTests.cs | Adds tests verifying multiple wildcard expectations are all enforced. |
| Tests/Mockolate.Api.Tests/Expected/Mockolate_netstandard2.0.txt | Updates API snapshot to include IStringContentBodyParameter.Exactly(). |
| Tests/Mockolate.Api.Tests/Expected/Mockolate_net8.0.txt | Updates API snapshot to include IStringContentBodyParameter.Exactly(). |
| Tests/Mockolate.Api.Tests/Expected/Mockolate_net10.0.txt | Updates API snapshot to include IStringContentBodyParameter.Exactly(). |
| Source/Mockolate/Web/ItExtensions.HttpContent.cs | Changes matcher storage to support multiple string predicates (AND semantics). |
| Source/Mockolate/Web/ItExtensions.HttpContent.WithString.cs | Implements WithString as substring match by default with an Exactly() modifier for full-body matching; wires Exactly() into wildcard matching too. |
| Source/Mockolate/Internals/Polyfills/StringExtensions.cs | Adds a NETSTANDARD2_0 polyfill for string.Contains(..., StringComparison). |
Tests/Mockolate.Tests/Web/ItExtensionsTests.IsHttpContentTests.WithStringTests.cs
Show resolved
Hide resolved
|
This is addressed in release v1.6.0. |



This PR extends Mockolate’s
It.IsHttpContent()matching so multiple body conditions can be combined, and introduces anExactly()modifier for strict string-body matching.Key Changes:
HttpContentbody matchers (AND semantics) instead of overwriting the previous matcher.WithStringmatching to support.Exactly()for full-body equality and expand tests for new composition scenarios.Exactly()method.HttpContent#510