public override object ExecuteScalar()
        {
            logger.Debug($"ExecuteScalar, command: {CommandText}");
            SFBaseResultSet resultSet = ExecuteInternal();

            resultSet.Next();
            return(resultSet.GetValue(0));
        }
        public override int ExecuteNonQuery()
        {
            logger.Debug($"ExecuteNonQuery, command: {CommandText}");
            SFBaseResultSet resultSet = ExecuteInternal();

            resultSet.Next();
            return(resultSet.CalculateUpdateCount());
        }
        public void TestSessionRenewDuringQueryExec()
        {
            Mock.MockRestSessionExpiredInQueryExec restRequester = new Mock.MockRestSessionExpiredInQueryExec();
            SFSession sfSession = new SFSession("account=test;user=test;password=test", null, restRequester);

            sfSession.Open();
            SFStatement     statement = new SFStatement(sfSession, restRequester);
            SFBaseResultSet resultSet = statement.Execute(0, "select 1", null, false);

            Assert.AreEqual(true, resultSet.Next());
            Assert.AreEqual("1", resultSet.GetString(0));
        }
        public void TestSessionRenew()
        {
            Mock.MockRestSessionExpired restRequester = new Mock.MockRestSessionExpired();
            SFSession sfSession = new SFSession("account=test;user=test;password=test", null, restRequester);

            sfSession.Open();
            SFStatement     statement = new SFStatement(sfSession, restRequester);
            SFBaseResultSet resultSet = statement.Execute(0, "select 1", null, false);

            Assert.AreEqual(true, resultSet.Next());
            Assert.AreEqual("1", resultSet.GetString(0));
            Assert.AreEqual("new_session_token", sfSession.sessionToken);
            Assert.AreEqual("new_master_token", sfSession.masterToken);
        }
Exemplo n.º 5
0
 public override bool Read()
 {
     return(resultSet.Next());
 }