public StoredNotificationsDispatchChannel(IStoredNotificationDispatcher <TKey> storedNotificationsDispatcher) { Dispatcher = storedNotificationsDispatcher; LimitCounter = new NoLimitCounter(); Interrupter = new ProgressiveTimeoutInterrupter <TKey>(); DeliveryType = (int)DeliveryTypes.StoredNotifications; }
public void ProgressiveTimeoutInterrupter_FailSingleTest() { var target = new ProgressiveTimeoutInterrupter <long>(); target.Fail(null, DispatcherAvailability.NotChecked); DateTime?timeoutEndTime = target.GetTimeoutEndUtc(); Assert.AreEqual(null, timeoutEndTime); }
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)); }
//init public DispatchChannel() { LimitCounter = new NoLimitCounter(); Interrupter = new ProgressiveTimeoutInterrupter <TKey>(); }