public void IgnoreUnknownSagaReferences() { var sagaStore = new Mock <IStoreSagas>(); var cache = new SagaTimeoutCache(sagaStore.Object, TimeSpan.FromMinutes(5)); cache.ClearTimeout(new SagaReference(typeof(Saga), GuidStrategy.NewGuid())); }
public void RemoveKnownSagaReferences() { 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.ClearTimeout(new SagaReference(sagaTimeout.SagaType, sagaTimeout.SagaId)); Assert.Equal(0, cache.Count); }
public void RemoveKnownSagaReferences() { 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.ClearTimeout(new SagaReference(sagaTimeout.SagaType, sagaTimeout.SagaId)); Assert.Equal(0, cache.Count); }
public void IgnoreUnknownSagaReferences() { var sagaStore = new Mock<IStoreSagas>(); var cache = new SagaTimeoutCache(sagaStore.Object, TimeSpan.FromMinutes(5)); cache.ClearTimeout(new SagaReference(typeof(Saga), GuidStrategy.NewGuid())); }