Пример #1
0
        public void Mark_transaction_wrapped_exceptions_as_transient()
        {
            var e = new TransactionException("Wrapped exception", SqlExceptionGenerator.GetSqlException(40197));

            Assert.That(new TTransientErrorDetectionStrategy().IsTransient(e));
        }
Пример #2
0
        public void Mark_invalid_operation_exception_wrapped_exceptions_as_transient()
        {
            var e = new InvalidOperationException("Lazy load error", new Exception("Wrapped exception", SqlExceptionGenerator.GetSqlException(40197)));

            Assert.That(new TTransientErrorDetectionStrategy().IsTransient(e));
        }
Пример #3
0
        public void Mark_wrapped_timeout_exception_as_transient([Values(-2, 121)] int errorCode)
        {
            var e = new Exception("Wrapped exception", SqlExceptionGenerator.GetSqlException(errorCode));

            Assert.That(new SqlAzureTransientErrorDetectionStrategyWithTimeouts().IsTransient(e));
        }