Beispiel #1
0
        public void When_adding_two_times_the_same_type_should_deduplicate()
        {
            var settings = new SettingsHolder();

            settings.AddUnrecoverableException(typeof(Exception));
            settings.AddUnrecoverableException(typeof(Exception));

            var result = settings.UnrecoverableExceptions();

            Assert.That(result, Has.Count.EqualTo(1));
            Assert.IsTrue(result.Contains(typeof(Exception)));
        }
Beispiel #2
0
        public void When_unrecoverable_exception_present_should_add_exception_type()
        {
            var settings = new SettingsHolder();

            settings.AddUnrecoverableException(typeof(Exception));
            settings.AddUnrecoverableException(typeof(InvalidOperationException));

            var result = settings.UnrecoverableExceptions();

            Assert.That(result, Has.Count.EqualTo(2));
            Assert.IsTrue(result.Contains(typeof(InvalidOperationException)));
        }
        void Configure(SettingsHolder settings)
        {
            #region UnrecoverableExceptionsSettings

            settings.AddUnrecoverableException(typeof(ValidationException));

            #endregion
        }
Beispiel #4
0
        public RecoverabilityComponent(SettingsHolder settings)
        {
            this.settings = settings;

            settings.SetDefault(NumberOfDelayedRetries, DefaultNumberOfRetries);
            settings.SetDefault(DelayedRetriesTimeIncrease, DefaultTimeIncrease);
            settings.SetDefault(NumberOfImmediateRetries, 5);
            settings.SetDefault(FaultHeaderCustomization, new Action <Dictionary <string, string> >(headers => { }));
            settings.AddUnrecoverableException(typeof(MessageDeserializationException));
        }