Question: Random port number #253

Closed
opened 2025-12-29 15:19:08 +01:00 by adam · 1 comment
Owner

Originally created by @raghu-romp on GitHub (Feb 27, 2020).

The MockServer for unit test says...

let WireMock choose dynamicaly ports. It might seem common sens, avoid hard coded ports in your tests!

How does my underlying HTTP caller know which port number to connect to?

Originally created by @raghu-romp on GitHub (Feb 27, 2020). The MockServer for unit test says... >let WireMock choose dynamicaly ports. It might seem common sens, avoid hard coded ports in your tests! How does my underlying HTTP caller know which port number to connect to?
adam added the question label 2025-12-29 15:19:08 +01:00
adam closed this issue 2025-12-29 15:19:08 +01:00
Author
Owner

@StefH commented on GitHub (Feb 27, 2020):

You can get the ports with server.Ports or you can get the urls server.Urls, example:
https://github.com/WireMock-Net/WireMock.Net/blob/master/test/WireMock.Net.Tests/WireMockServerTests.cs#L50

@StefH commented on GitHub (Feb 27, 2020): You can get the ports with `server.Ports` or you can get the urls `server.Urls`, example: https://github.com/WireMock-Net/WireMock.Net/blob/master/test/WireMock.Net.Tests/WireMockServerTests.cs#L50
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net-wiremock#253