Ejemplo n.º 1
0
        public void Execute_WaitFor3SecondsTimeoutSetTo0_NoTimeOut()
        {
            var query = "WAITFOR DELAY '00:00:03';";
            var cmd   = new OleDbCommand(query, new OleDbConnection(ConnectionStringReader.GetOleDbSql()));

            cmd.CommandTimeout = 0;

            var qe = new QueryOleDbEngine(cmd);

            Assert.DoesNotThrow(delegate { qe.Execute(); });
        }
Ejemplo n.º 2
0
        public void Execute_WaitFor3SecondsTimeoutSetTo1_Timeout()
        {
            var query = "WAITFOR DELAY '00:00:10';";
            var cmd   = new OleDbCommand(query, new OleDbConnection(ConnectionStringReader.GetOleDbSql()));

            cmd.CommandTimeout = 1;

            var qe = new QueryOleDbEngine(cmd);

            Assert.Throws <CommandTimeoutException>(delegate { qe.Execute(); });
        }