public async Task Cannot_lock_twice_in_parallel()
 {
     var dict = new AsyncLockDictionary<string>();
     var touchable = new Touchable(1);
     await SpamAsync(10000, async () =>
     {
         using (await dict.LockAsync("A"))
         {
             await touchable.TouchAsync();
         }
     });
     Assert.AreEqual(10000, touchable.TouchCount);
 }
 public async Task Can_lock_different_keys_in_parallel()
 {
     var dict = new AsyncLockDictionary<int>();
     var touchable = new Touchable(10);
     await Task.WhenAll(Enumerable.Range(0, 10)
         .Select(i => SpamAsync(1000, async () =>
         {
             using (await dict.LockAsync(i))
             {
                 await touchable.TouchAsync();
             }
         })));
     Assert.AreEqual(10000, touchable.TouchCount);
 }