示例#1
0
        protected override async Task <ConnectionContext> CreateConnection()
        {
            _connectionContext = await base.CreateConnection() as TestConnectionContext;

            await WriteMessageAsync(new HandshakeResponseMessage());

            return(_connectionContext);
        }
示例#2
0
            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));
            }
示例#3
0
        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));
        }