public void CreateNewSessionTableCmd_Should_Create_SqlCommand_Without_Parameters()
        {
            var helper = new NpgsqlCommandHelper(SqlCommandTimeout);

            var cmd = helper.CreateNewSessionTableCmd(SqlStatement);

            VerifyBasicsOfSqlCommand(cmd);
            Assert.Empty(cmd.Parameters);
        }
        public void CreateDeleteExpiredSessionsCmd_Should_Create_SqlCommand_Withone_Parameters()
        {
            var helper = new NpgsqlCommandHelper(SqlCommandTimeout);

            var cmd = helper.CreateDeleteExpiredSessionsCmd(SqlStatement);

            VerifyBasicsOfSqlCommand(cmd);
            Assert.Single(cmd.Parameters);
        }
        public void CreateResetItemTimeoutCmd_Should_Create_SqlCommand_With_Right_Parameters()
        {
            var helper = new NpgsqlCommandHelper(SqlCommandTimeout);

            var cmd = helper.CreateResetItemTimeoutCmd(SqlStatement, SessionId);

            VerifyBasicsOfSqlCommand(cmd);
            VerifySessionIdParameter(cmd);
            //lockdate
            Assert.Equal(2, cmd.Parameters.Count);
        }
        public void CreateRemoveStateItemCmd_Should_Create_SqlCommand_With_Right_Parameters(object lockId)
        {
            var helper = new NpgsqlCommandHelper(SqlCommandTimeout);

            var cmd = helper.CreateRemoveStateItemCmd(SqlStatement, SessionId, lockId);

            VerifyBasicsOfSqlCommand(cmd);
            VerifySessionIdParameter(cmd);
            //    VerifyLockCookieParameter(cmd, lockId);
            Assert.Equal(1, cmd.Parameters.Count);
        }
        public void CreateGetStateItemCmd_Should_Create_SqlCommand_With_Right_Parameters()
        {
            var helper = new NpgsqlCommandHelper(SqlCommandTimeout);

            var cmd = helper.CreateGetStateItemCmd(SqlStatement, SessionId);

            VerifyBasicsOfSqlCommand(cmd);
            VerifySessionIdParameter(cmd);
            //VerifyLockedParameter(cmd);
            //VerifyLockAgeParameter(cmd);
            //VerifyLockCookieParameter(cmd);
            //VerifyActionFlagsParameter(cmd);
            Assert.Equal(2, cmd.Parameters.Count);
        }
        public void CreateTempInsertUninitializedItemCmd_Should_Create_SqlCommand_With_Right_Parameters()
        {
            var helper = new NpgsqlCommandHelper(SqlCommandTimeout);

            var cmd = helper.CreateTempInsertUninitializedItemCmd(SqlStatement, SessionId, BufferLength, Buffer, SessionTimeout);

            VerifyBasicsOfSqlCommand(cmd);
            VerifySessionIdParameter(cmd);
            VerifySessionItemLongParameter(cmd);
            VerifyTimeoutParameter(cmd);
            //lockdate
            //lockdatelocal
            //expirestime
            Assert.Equal(6, cmd.Parameters.Count);
        }
        public void CreateUpdateStateItemLongCmd_Should_Create_SqlCommand_With_Right_Parameters()
        {
            var helper = new NpgsqlCommandHelper(SqlCommandTimeout);

            var cmd = helper.CreateUpdateStateItemLongCmd(SqlStatement, SessionId, Buffer, BufferLength, SessionTimeout, LockId);

            VerifyBasicsOfSqlCommand(cmd);
            VerifySessionIdParameter(cmd);
            VerifySessionItemLongParameter(cmd);
            VerifyTimeoutParameter(cmd);
            //lockdate
            //expiresin
            //VerifyLockCookieParameter(cmd, LockId);
            Assert.Equal(5, cmd.Parameters.Count);
        }
        public void Constructor_Should_Initialize_CommandTimeout()
        {
            var helper = new NpgsqlCommandHelper(SqlCommandTimeout);

            Assert.Equal(SqlCommandTimeout, helper.CommandTimeout);
        }