1

I am creating a test server for integration tests like so, and this works well for all HttpClient requests...

Environment.SetEnvironmentVariable("ASPNETCORE_ENVIRONMENT", "IntegrationTesting");
var appBuilder = new WebApplicationFactory<Program>()
    .WithWebHostBuilder(builder =>
    {
        builder.ConfigureTestServices(services =>
        {
            services.AddScoped(sp => MockUserMessagingService.Object);
            services.AddSingleton(sp => MockDealerStrategy.Object);
        });
        builder.UseSetting("https_port", "8080");
    });

HttpClient = appBuilder.CreateClient();

I now also need to connect a ClientWebSocket to that test server. Can someone tell me how that is done?

Peter Morris
  • 20,174
  • 9
  • 81
  • 146

0 Answers0