internal static AsyncSession NewSession(IBoltProtocol protocol, IDriverLogger logger = null,
     IAsyncRetryLogic retryLogic = null, AccessMode mode = AccessMode.Write, string bookmark = null,
     bool reactive = false)
 {
     var mockConn = new Mock<IConnection>();
     mockConn.Setup(x => x.IsOpen).Returns(true);
     mockConn.Setup(x => x.BoltProtocol).Returns(protocol);
     return new AsyncSession(new TestConnectionProvider(mockConn.Object), logger, retryLogic, mode,
         Bookmark.From(bookmark), reactive);
 }
Exemple #2
0
        internal Driver(Uri uri, IConnectionProvider connectionProvider, IAsyncRetryLogic retryLogic, IDriverLogger logger,
                        IMetrics metrics = null, Config config = null)
        {
            Throw.ArgumentNullException.IfNull(connectionProvider, nameof(connectionProvider));

            Uri                 = uri;
            _logger             = logger;
            _connectionProvider = connectionProvider;
            _retryLogic         = retryLogic;
            _metrics            = metrics;
            _config             = config;
        }
        public AsyncSession(IConnectionProvider provider, IDriverLogger logger, IAsyncRetryLogic retryLogic = null,
                            AccessMode defaultMode = AccessMode.Write, Bookmark bookmark = null,
                            bool reactive          = false)
        {
            _logger             = logger;
            _connectionProvider = provider;
            _retryLogic         = retryLogic;
            _reactive           = reactive;

            _defaultMode = defaultMode;
            UpdateBookmark(bookmark);
        }
        public AsyncSession(IConnectionProvider provider, ILogger logger, IAsyncRetryLogic retryLogic = null,
                            AccessMode defaultMode = AccessMode.Write, string database = null, Bookmark bookmark = null,
                            bool reactive          = false, long fetchSize = Config.Infinite)
        {
            _logger             = logger;
            _connectionProvider = provider;
            _retryLogic         = retryLogic;
            _reactive           = reactive;
            _database           = database;

            _defaultMode = defaultMode;
            _fetchSize   = fetchSize;
            UpdateBookmark(bookmark);
        }
Exemple #5
0
 internal static AsyncSession NewSession(IConnection connection, ILogger logger = null,
                                         IAsyncRetryLogic retryLogic            = null, AccessMode mode = AccessMode.Write, string bookmark = null)
 {
     return(new AsyncSession(new TestConnectionProvider(connection), logger, retryLogic, mode, null,
                             Bookmark.From(bookmark)));
 }