mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 21:10:32 +01:00
.Net Aspire : Replacing a dependency in tests with Wiremock #660
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 @hibri on GitHub (Dec 31, 2024).
Originally assigned to: @StefH on GitHub.
I'm using .Net Aspire, and looking to replace an API dependency with Wiremock.
The project "api" calls a downstream service "ingredients", that I want to mock.
For example, in my test project, I have
I'm creating a http client for api, to create and send a request.
The code for the controller handling the request looks like this;
I'm assuming that when the dependency for ingredients is resolved, we get a reference to the Wiremock instance. But this does not happen.
Hope this makes sense, or is this scenario not supported?
@StefH commented on GitHub (Dec 31, 2024):
I think that your api is not really using the wiremock - ingredients?
Can you also take a look here:
https://github.com/WireMock-Net/WireMock.Net/tree/master/examples-Aspire
@hibri commented on GitHub (Jan 6, 2025):
Let me take another look. Thanks for replying on New Year's eve. Appreciate the fast response. Happy New Year
@StefH commented on GitHub (Jan 18, 2025):
Did you manage to get it working?