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

            var qp  = new OleDbPerformanceEngine(cmd.Connection, cmd);
            var res = qp.Execute(new TimeSpan(0, 0, 1));

            Assert.That(res.TimeOut.TotalMilliseconds, Is.EqualTo(1000));
            Assert.That(res.IsTimeOut, Is.True);
        }
Exemplo n.º 2
0
        public void CheckPerformance_OneQuery_ReturnElapsedTime()
        {
            var sql = "WAITFOR DELAY '00:00:00';";
            var cmd = new OleDbCommand(sql, new OleDbConnection(ConnectionStringReader.GetOleDbSql()));

            var qp  = new OleDbPerformanceEngine(cmd.Connection, cmd);
            var res = qp.Execute(new TimeSpan(0, 1, 0));

            Assert.That(res.TimeElapsed.TotalMilliseconds, Is.GreaterThanOrEqualTo(0).And.LessThan(5000));
            Assert.That(res.IsTimeOut, Is.False);
        }