public async Task ResultBuilderShouldObtainServerInfoFromConnection()
            {
                var mockConn  = SessionTests.MockedConnectionWithSuccessResponse();
                var statement = new Statement("lalala");

                await BoltV3.RunInExplicitTransactionAsync(mockConn.Object, statement, true);

                mockConn.Verify(x => x.Server, Times.Once);
            }
Exemplo n.º 2
0
            public async Task ShouldRunPullAllSync()
            {
                var mockConn = SessionTests.MockedConnectionWithSuccessResponse();
                var query    = new Query("lalala");

                await BoltV4.RunInExplicitTransactionAsync(mockConn.Object, query, true);

                mockConn.Verify(
                    x => x.EnqueueAsync(It.IsAny <RunWithMetadataMessage>(), It.IsAny <V4.RunResponseHandler>(), null,
                                        null),
                    Times.Once);
                mockConn.Verify(x => x.SendAsync(), Times.Once);
            }
            public async Task ShouldRunPullAllSync()
            {
                var mockConn  = SessionTests.MockedConnectionWithSuccessResponse();
                var statement = new Statement("lalala");

                await BoltV1.RunInExplicitTransactionAsync(mockConn.Object, statement, true);

                mockConn.Verify(
                    x => x.EnqueueAsync(It.IsAny <RunMessage>(), It.IsAny <V1.RunResponseHandler>(), PullAllMessage.PullAll,
                                        It.IsAny <V1.PullResponseHandler>()),
                    Times.Once);
                mockConn.Verify(x => x.SendAsync(), Times.Once);
            }