예제 #1
0
            public async Task ResultBuilderShouldObtainServerInfoFromConnection()
            {
                var mockConn = MockedConnectionWithSuccessResponse();
                var statment = new Statement("lalala");

                await BoltV1.RunInExplicitTransactionAsync(mockConn.Object, statment);

                mockConn.Verify(x => x.Server, Times.Once);
            }
예제 #2
0
            public async Task ShouldRunPullAllSync()
            {
                var mockConn = MockedConnectionWithSuccessResponse();
                var statment = new Statement("lalala");

                await BoltV1.RunInExplicitTransactionAsync(mockConn.Object, statment);

                mockConn.Verify(x => x.Enqueue(It.IsAny <RunMessage>(), It.IsAny <ResultCursorBuilder>(), PullAll), 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);
            }