public void TestTypesProvidedInConstructor() { this.classifier = new BinaryExceptionClassifier(new List <Type> { typeof(InvalidOperationException) }); Assert.IsTrue(this.classifier.Classify(new InvalidOperationException("Foo"))); }
public void TestTypesProvidedInConstructorWithNonDefault() { this.classifier = new BinaryExceptionClassifier(new List <Type> { typeof(InvalidOperationException) }, false); Assert.IsFalse(this.classifier.Classify(new InvalidOperationException("Foo"))); }
public PollyRetryTemplate(Dictionary <Type, bool> retryableExceptions, int maxAttempts, bool defaultRetryable, int backOffInitialInterval, int backOffMaxInterval, double backOffMultiplier) { _retryableExceptions = new BinaryExceptionClassifier(retryableExceptions, defaultRetryable); _maxAttempts = maxAttempts; _backOffInitialInterval = backOffInitialInterval; _backOffMaxInterval = backOffMaxInterval; _backOffMultiplier = backOffMultiplier; }
/// <summary>Initializes a new instance of the <see cref="SimpleRetryPolicy"/> class.</summary> /// <param name="maxAttempts">The max attempts.</param> /// <param name="retryableExceptions">The retryable exceptions.</param> public SimpleRetryPolicy(int maxAttempts, IDictionary<Type, bool> retryableExceptions) { this.maxAttempts = maxAttempts; this.retryableClassifier = new BinaryExceptionClassifier(retryableExceptions); }
public void SetUp() { this.classifier = new BinaryExceptionClassifier(false); }
public void TestDefaultProvided() { this.classifier = new BinaryExceptionClassifier(true); Assert.IsTrue(this.classifier.GetDefault()); }
public void TestTypesProvidedInConstructorWithNonDefault() { this.classifier = new BinaryExceptionClassifier(new List<Type> { typeof(InvalidOperationException) }, false); Assert.IsFalse(this.classifier.Classify(new InvalidOperationException("Foo"))); }
public void TestTypesProvidedInConstructor() { this.classifier = new BinaryExceptionClassifier(new List<Type> { typeof(InvalidOperationException) }); Assert.IsTrue(this.classifier.Classify(new InvalidOperationException("Foo"))); }
/// <summary>Initializes a new instance of the <see cref="SimpleRetryPolicy"/> class.</summary> /// <param name="maxAttempts">The max attempts.</param> /// <param name="retryableExceptions">The retryable exceptions.</param> public SimpleRetryPolicy(int maxAttempts, IDictionary <Type, bool> retryableExceptions) { this.maxAttempts = maxAttempts; this.retryableClassifier = new BinaryExceptionClassifier(retryableExceptions); }