public async Task ShouldSendsTasksInParallel() { var slowClass = new SlowClassAsync(); await AsyncRepeater.Go(nomberOfTests, async() => await slowClass.ProcessSlowly()); Assert.AreEqual(nomberOfTests, slowClass.Counter); }
public async Task ParallelAccessToAsyncMethod() { var slowClass = new SlowClassAsync(); await AsyncRepeater.Go(numberOfTests, () => cache.BlitzGet(slowClass.ProcessQuickly)); Assert.AreEqual(1, slowClass.Counter); }
public async Task DifferentKeysWillCallTheAsyncMethodAgain() { var slowClass = new SlowClassAsync(); var key1 = Guid.NewGuid().ToString(); await AsyncRepeater.Go(numberOfTests, () => cache.BlitzGet(key1, slowClass.ProcessQuickly)); var key2 = Guid.NewGuid().ToString(); await AsyncRepeater.Go(numberOfTests, () => cache.BlitzGet(key2, slowClass.ProcessQuickly)); Assert.AreEqual(2, slowClass.Counter); }