Set dummy IP address in integration test with Asp.Net Core TestServer
问题 I have a C# Asp.Net Core (1.x) project, implementing a web REST API, and its related integration test project, where before any test there's a setup similar to: // ... IWebHostBuilder webHostBuilder = GetWebHostBuilderSimilarToRealOne() .UseStartup<MyTestStartup>(); TestServer server = new TestServer(webHostBuilder); server.BaseAddress = new Uri("http://localhost:5000"); HttpClient client = server.CreateClient(); // ... During tests, the client is used to send HTTP requests to web API (the