private async Task EnqueAndSync(IBoltProtocol protocol) { var mockConn = new Mock <IConnection>(); mockConn.Setup(x => x.Server).Returns(new ServerInfo(new Uri("http://neo4j.com"))); await protocol.LoginAsync(mockConn.Object, "user-andy", AuthTokens.None); mockConn.Verify( x => x.EnqueueAsync(It.IsAny <HelloMessage>(), It.IsAny <V3.HelloResponseHandler>(), null, null), Times.Once); mockConn.Verify(x => x.SyncAsync()); }
public async Task InitAsync() { _sendLock.Wait(); try { _boltProtocol = await _client.ConnectAsync(RoutingContext).ConfigureAwait(false); } finally { _sendLock.Release(); } await _boltProtocol.LoginAsync(this, _userAgent, _authToken).ConfigureAwait(false); }
public async Task InitAsync() { _boltProtocol = await _client.ConnectAsync().ConfigureAwait(false); await _boltProtocol.LoginAsync(this, _userAgent, _authToken).ConfigureAwait(false); }