public void TestSessionRenew()
        {
            Mock.MockRestSessionExpired rest = new Mock.MockRestSessionExpired();
            SFSession sfSession = new SFSession("account=test;user=test;password=test", null, rest);

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

            Assert.AreEqual(true, resultSet.Next());
            Assert.AreEqual("1", resultSet.GetString(0));
        }
Пример #2
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);
            Assert.AreEqual(restRequester.FirstTimeRequestID, restRequester.SecondTimeRequestID);
        }