Exemple #1
0
        public static IEnumerable <object[]> GetNoneRetriableCondition()
        {
            RetryLogicTestHelper.SetRetrySwitch(true);
            yield return(new object[] { DataTestUtility.TCPConnectionString, null });

            yield return(new object[] { DataTestUtility.TCPConnectionString, SqlConfigurableRetryFactory.CreateNoneRetryProvider() });

            RetryLogicTestHelper.SetRetrySwitch(false);
            yield return(new object[] { DataTestUtility.TCPConnectionString, null });

            yield return(new object[] { DataTestUtility.TCPConnectionString, SqlConfigurableRetryFactory.CreateNoneRetryProvider() });

            var option = new SqlRetryLogicOption()
            {
                NumberOfTries   = 2,
                DeltaTime       = TimeSpan.FromMilliseconds(10),
                MaxTimeInterval = TimeSpan.FromSeconds(2)
            };

            foreach (var provider in GetRetryStrategies(option))
            {
                yield return new object[] { DataTestUtility.TCPConnectionString, provider[0] }
            }
            ;
        }
Exemple #2
0
        public static IEnumerable <object[]> GetNoneRetriableCondition()
        {
            yield return(new object[] { DataTestUtility.TCPConnectionString, null });

            yield return(new object[] { DataTestUtility.TCPConnectionString, SqlConfigurableRetryFactory.CreateNoneRetryProvider() });
        }
 /// <summary>
 /// The default non retry provider will apply if a parameter passes by null.
 /// </summary>
 private void AssignProviders(SqlRetryLogicBaseProvider cnnProvider = null, SqlRetryLogicBaseProvider cmdProvider = null)
 {
     ConnectionProvider = cnnProvider ?? SqlConfigurableRetryFactory.CreateNoneRetryProvider();
     CommandProvider    = cmdProvider ?? SqlConfigurableRetryFactory.CreateNoneRetryProvider();
 }