public void DoNotCacheTimeoutsFarInFuture()
            {
                var now         = DateTime.UtcNow;
                var sagaStore   = new Mock <IStoreSagas>();
                var cache       = new SagaTimeoutCache(sagaStore.Object, TimeSpan.FromMinutes(5));
                var sagaTimeout = new SagaTimeout(typeof(Saga), GuidStrategy.NewGuid(), now.AddMinutes(10));

                sagaStore.Setup(mock => mock.GetScheduledTimeouts(It.IsAny <DateTime>())).Returns(new[] { sagaTimeout });

                SystemTime.OverrideWith(() => now);

                cache.GetElapsedTimeouts();
                cache.ScheduleTimeout(sagaTimeout);

                Assert.Equal(0, cache.Count);
            }
            public void DoNotCacheTimeoutsFarInFuture()
            {
                var now = DateTime.UtcNow;
                var sagaStore = new Mock<IStoreSagas>();
                var cache = new SagaTimeoutCache(sagaStore.Object, TimeSpan.FromMinutes(5));
                var sagaTimeout = new SagaTimeout(typeof(Saga), GuidStrategy.NewGuid(), now.AddMinutes(10));

                sagaStore.Setup(mock => mock.GetScheduledTimeouts(It.IsAny<DateTime>())).Returns(new[] { sagaTimeout });

                SystemTime.OverrideWith(() => now);

                cache.GetElapsedTimeouts();
                cache.ScheduleTimeout(sagaTimeout);

                Assert.Equal(0, cache.Count);
            }