public CachedSnapshotManager( ISnapshotPersister persister, ISnapshotPersistenceStrategy snapshotPersistenceStrategy, Boolean cacheEnabled = true, CacheItemPolicy cacheItemPolicy = null) { _cache = new MemoryCache("CachedSnapshotManager"); _persister = persister; _snapshotPersistenceStrategy = snapshotPersistenceStrategy; _standardCachePolicy = cacheItemPolicy ?? new CacheItemPolicy() { SlidingExpiration = TimeSpan.FromMinutes(10) }; _cacheEnabled = cacheEnabled; }
public void SetUp() { _persister = NSubstitute.Substitute.For <ISnapshotPersister>(); _snapshotPersistenceStrategy = new NumberOfCommitsShapshotPersistenceStrategy(NumberOfCommitsBeforeSnapshot); _sut = new CachedSnapshotManager(_persister, _snapshotPersistenceStrategy); }