mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 22:30:41 +01:00
FluentAssertions extensions are not open for extension #582
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @chrischu on GitHub (Mar 4, 2024).
Originally assigned to: @StefH on GitHub.
Is your feature request related to a problem? Please describe.
Currently the FluentAssertion extensions offer a pretty small feature set, which would not be a problem by itself, but the fact that they are not very open for extension makes this really problematic.
Describe the solution you'd like
I would like to for example access all the filtered requests on the
WireMockAssertionsobject. That way I could write my own extension methods for it to for example assert that a request was using a specific path (currently only Url & AbsoluteUrl exist).Describe alternatives you've considered
As far as I can tell the only alternative is using reflection to access the private members of
WireMockAssertions.@StefH commented on GitHub (Mar 9, 2024):
@chrischu
I've updated the code for WireMockAssertions so that you now can create an extension method like:
Note that the RequestMessages, BuildFilterAndCondition and FilterRequestMessages are made public so these can be used in the extension methods.
Would this fix your issue?
And if you have any useful default fliuent extensions, you can also add these to this project using a PR.
@chrischu commented on GitHub (Mar 12, 2024):
Oh sorry I just saw the comment, yes this looks perfect, thank you!