using Microsoft.AspNetCore.SignalR.Client; using static System.Net.WebRequestMethods; using static Microsoft.AspNetCore.Http.StatusCodes; namespace ExampleSignalR.Test; public class UnitTest1 : BaseIntegrationTest { private readonly HttpClient _httpClient; public UnitTest1(WebAppFactoryFixture factory) : base(factory) { _httpClient = factory.CreateClient(); } [Fact] public async void ConnectToSignalRHub() { var hubConnection = new HubConnectionBuilder() .WithUrl($"{factory.url}/chatHub") // ...appsettings.json .Build(); await hubConnection.StartAsync(); } //public async Task Connect() //{ // try // { // await hubConnection.StartAsync(); // Console.WriteLine("Чат подключен..."); // } // catch (Exception ex) // { // Console.WriteLine($"Ошибка подключения: {ex.Message}"); // } //} }