public void CreateAndReadAtSameTimeTest( string cacheType, Func<string, Action<AsyncSubject<byte[]>>, PersistentBlobCache> factory) { var cache = factory("somepath", _ => {}); var stresser = new Stresser(new Action<string>[] { key => cache.Insert(key, Stresser.RandomData()), key => cache.GetAsync(key).First() }); var exceptions = stresser.RunActions(TimeSpan.FromSeconds(2)); cache.Dispose(); cache.Shutdown.Wait(); Assert.Equal("", String.Join(",", exceptions)); }
public void CreateAndReadAtSameTimeTest( string cacheType, Func <string, Action <AsyncSubject <byte[]> >, PersistentBlobCache> factory) { var cache = factory("somepath", _ => {}); var stresser = new Stresser(new Action <string>[] { key => cache.Insert(key, Stresser.RandomData()), key => cache.GetAsync(key).First() }); var exceptions = stresser.RunActions(TimeSpan.FromSeconds(2)); cache.Dispose(); cache.Shutdown.Wait(); Assert.Equal("", String.Join(",", exceptions)); }