protected IReadWriteBinding CreateReadWriteBinding(bool useImplicitSession = false)
        {
            var options = new CoreSessionOptions(isImplicit: useImplicitSession);
            var session = CoreTestConfiguration.StartSession(_cluster, options);

            return(new WritableServerBinding(_cluster, session));
        }
Exemplo n.º 2
0
        public ICoreSessionHandle StartSession(CoreSessionOptions options)
        {
            options = options ?? new CoreSessionOptions();
            var session = new CoreSession(this, _serverSessionPool, options);

            return(new CoreSessionHandle(session));
        }
        public ICoreSessionHandle StartSession(CoreSessionOptions options)
        {
            options = options ?? new CoreSessionOptions();
            var serverSession = AcquireServerSession();
            var session       = new CoreSession(serverSession, options);

            return(new CoreSessionHandle(session));
        }
        public ICoreSessionHandle StartSession(CoreSessionOptions options = null)
        {
            ThrowIfDisposed();

            options = options ?? new CoreSessionOptions();
            var session = new CoreSession(this, _serverSessionPool, options);

            return(new CoreSessionHandle(session));
        }
Exemplo n.º 5
0
        public void StartSession_should_return_expected_result()
        {
            var subject = CreateSubject();
            var options = new CoreSessionOptions();

            var result = subject.StartSession(options);

            result.Options.Should().BeSameAs(options);
            result.ServerSession.Should().NotBeNull();
        }
Exemplo n.º 6
0
        // private methods
        private ICoreSessionHandle CreateCoreSession(
            ICoreServerSession serverSession = null,
            CoreSessionOptions options       = null)
        {
            serverSession = serverSession ?? new CoreServerSession();
            options       = options ?? new CoreSessionOptions();

            var mockCoreSession = new Mock <ICoreSessionHandle>();

            mockCoreSession.SetupGet(m => m.Options).Returns(options);
            mockCoreSession.SetupGet(m => m.ServerSession).Returns(serverSession);
            mockCoreSession.Setup(m => m.Fork()).Returns(() => CreateCoreSession(serverSession: serverSession, options: options));
            return(mockCoreSession.Object);
        }
Exemplo n.º 7
0
        // private methods
        private Mock <ICoreSessionHandle> CreateCoreSessionMock(
            ICoreServerSession serverSession = null,
            CoreSessionOptions options       = null)
        {
            serverSession = serverSession ?? new CoreServerSession();
            options       = options ?? new CoreSessionOptions();

            var mockCoreSession = new Mock <ICoreSessionHandle>();

            mockCoreSession.Setup(m => m.CurrentTransaction).Returns(new CoreTransaction(It.IsAny <long>(), It.IsAny <TransactionOptions>()));
            mockCoreSession.SetupGet(m => m.Options).Returns(options);
            mockCoreSession.SetupGet(m => m.ServerSession).Returns(serverSession);
            mockCoreSession.Setup(m => m.Fork()).Returns(() => CreateCoreSession(serverSession: serverSession, options: options));
            return(mockCoreSession);
        }
        private ICoreSessionHandle CreateSession(ICluster cluster, bool useImplicitSession)
        {
            var options = new CoreSessionOptions(isImplicit: useImplicitSession);

            return(CoreTestConfiguration.StartSession(cluster, options));
        }
Exemplo n.º 9
0
 private ICoreSessionHandle CreateCoreSession(
     ICoreServerSession serverSession = null,
     CoreSessionOptions options       = null)
 {
     return(CreateCoreSessionMock(serverSession, options).Object);
 }
Exemplo n.º 10
0
 public ICoreSessionHandle StartSession(CoreSessionOptions options = null) => throw new NotImplementedException();