public StoredNotificationsDispatchChannel(IStoredNotificationDispatcher <TKey> storedNotificationsDispatcher)
 {
     Dispatcher   = storedNotificationsDispatcher;
     LimitCounter = new NoLimitCounter();
     Interrupter  = new ProgressiveTimeoutInterrupter <TKey>();
     DeliveryType = (int)DeliveryTypes.StoredNotifications;
 }
Example #2
0
        public void ProgressiveTimeoutInterrupter_FailSingleTest()
        {
            var target = new ProgressiveTimeoutInterrupter <long>();

            target.Fail(null, DispatcherAvailability.NotChecked);

            DateTime?timeoutEndTime = target.GetTimeoutEndUtc();

            Assert.AreEqual(null, timeoutEndTime);
        }
Example #3
0
        public void ProgressiveTimeoutInterrupter_FailManyMaxTest()
        {
            var target = new ProgressiveTimeoutInterrupter <long>();

            for (int i = 0; i < 100; i++)
            {
                target.Fail(null, DispatcherAvailability.NotChecked);
            }

            DateTime?timeoutEndTime = target.GetTimeoutEndUtc();
            DateTime expected       = DateTime.UtcNow.Add(target.TimeoutMaxDuration);

            timeoutEndTime.Value.ShouldBe(expected, TimeSpan.FromSeconds(1));
        }
Example #4
0
 //init
 public DispatchChannel()
 {
     LimitCounter = new NoLimitCounter();
     Interrupter  = new ProgressiveTimeoutInterrupter <TKey>();
 }