Exemplo n.º 1
0
        public void TestSqlContextNewSession()
        {
            // arrange
            var sessionProxy = new SqlContextIpcProxy(new JvmObjectReference("1"));
            mockSqlContextProxy.Setup(m => m.NewSession()).Returns(sessionProxy);
            var sqlContext = new SqlContext(new SparkContext("", ""), mockSqlContextProxy.Object);

            // act
            var actualNewSession = sqlContext.NewSession();

            // assert
            Assert.AreEqual(sessionProxy, actualNewSession.SqlContextProxy);
        }
Exemplo n.º 2
0
        public void TestSqlContextGetConf()
        {
            // arrange
            const string key = "key";
            const string value = "value";
            var sessionProxy = new SqlContextIpcProxy(new JvmObjectReference("1"));
            mockSqlContextProxy.Setup(m => m.GetConf(key, "")).Returns(value);
            var sqlContext = new SqlContext(new SparkContext("", ""), mockSqlContextProxy.Object);

            // act
            var actualValue = sqlContext.GetConf(key, "");

            // assert
            Assert.AreEqual(value, actualValue);
        }