protected override async Task <ConnectionContext> CreateConnection() { _connectionContext = await base.CreateConnection() as TestConnectionContext; await WriteMessageAsync(new HandshakeResponseMessage()); return(_connectionContext); }
public Task <ConnectionContext> ConnectAsync(TransferFormat transferFormat, string connectionId, string hubName, CancellationToken cancellationToken = default) { var connection = new TestConnectionContext(); _connectCallback?.Invoke(connection); _waitForServerConnection.TrySetResult(connection); return(Task.FromResult <ConnectionContext>(connection)); }
public Task <ConnectionContext> ConnectAsync(TransferFormat transferFormat, string connectionId, string target, CancellationToken cancellationToken = default, IDictionary <string, string> headers = null) { var connection = new TestConnectionContext(); _connectCallback?.Invoke(connection); _waitForServerConnection.TrySetResult(connection); return(Task.FromResult <ConnectionContext>(connection)); }