24 lines
672 B
C#
24 lines
672 B
C#
using Microsoft.AspNetCore.SignalR.Protocol;
|
|
|
|
namespace Microsoft.AspNetCore.SignalR.Client.Tests
|
|
{
|
|
public partial class HubConnectionTests
|
|
{
|
|
private static HubConnection CreateHubConnection(TestConnection connection, IHubProtocol protocol = null)
|
|
{
|
|
var builder = new HubConnectionBuilder();
|
|
builder.WithConnectionFactory(async format =>
|
|
{
|
|
await connection.StartAsync(format);
|
|
return connection;
|
|
});
|
|
if (protocol != null)
|
|
{
|
|
builder.WithHubProtocol(protocol);
|
|
}
|
|
|
|
return builder.Build();
|
|
}
|
|
}
|
|
}
|