mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 22:30:41 +01:00
Localhost and free port problem #156
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 @SabrinaMH on GitHub (Dec 13, 2018).
I have a unit test, where I have the following code
And then later in the test I have
where the getRequest is targeted http://localhost:9002/recommendations
However, when I run this test, I end up with a TaskCanceled exception. It hangs in the _httpClient.SendAsync method for quite a while, which then throws this exceptions.
@StefH commented on GitHub (Dec 13, 2018):
Difficult to see what's wrong. Can you post your complete test?
A question : are you sure the real code is connecting to the WireMock server?
As an example see:
dffeb95116/test/WireMock.Net.Tests/FluentMockServerTests.cs (L98)Example:
@SabrinaMH commented on GitHub (Dec 17, 2018):
Thanks!!
I thought (wrongly) that if I only used WithPath("XXX"), then WireMock would intercept traffic on all ports and thus be able to stub all endpoints (regardless of the port) that had path XXX.
@StefH commented on GitHub (Dec 17, 2018):
OK. Closing this question.