コード例 #1
0
        public void TestExecuteWithVarargsAndRetryActionReturnsValidResult()
        {
            var driver = new PooledQldbDriver("ledgerName", mockClient.Object, 4, 1, 10, NullLogger.Instance);
            var result = driver.Execute("testStatement", (int k) => { return; }, new IIonValue[] { });

            Assert.IsNotNull(result);
        }
コード例 #2
0
        public void TestExecuteWithParamsReturnsValidResult()
        {
            var driver = new PooledQldbDriver("ledgerName", mockClient.Object, 4, 1, 10, NullLogger.Instance);
            var result = driver.Execute("testStatement", new List <IIonValue>());

            Assert.IsNotNull(result);
        }
コード例 #3
0
        public void TestExecuteWithActionLambdaAndRetryActionCanInvokeSuccessfully()
        {
            var driver = new PooledQldbDriver("ledgerName", mockClient.Object, 4, 1, 10, NullLogger.Instance);

            driver.Execute((txn) =>
            {
                txn.Execute("testStatement");
            }, (int k) => { return; });
        }
コード例 #4
0
        public void TestExecuteWithFuncLambdaAndRetryActionReturnsFuncOutput()
        {
            var driver = new PooledQldbDriver("ledgerName", mockClient.Object, 4, 1, 10, NullLogger.Instance);

            driver.Dispose();
            Assert.ThrowsException <ObjectDisposedException>(() => driver.Execute((txn) =>
            {
                txn.Execute("testStatement");
                return("testReturnValue");
            }, (int k) => { return; }));
        }
コード例 #5
0
        public void TestExecuteWithFuncLambdaReturnsFuncOutput()
        {
            var driver = new PooledQldbDriver("ledgerName", mockClient.Object, 4, 1, 10, NullLogger.Instance);
            var result = driver.Execute((txn) =>
            {
                txn.Execute("testStatement");
                return("testReturnValue");
            });

            Assert.AreEqual("testReturnValue", result);
        }