public async Task ClearAsyncTest() { DictionaryChange change = null; TransactedConcurrentDictionary <int, string> d = new TransactedConcurrentDictionary <int, string>( new Uri("test://mocks", UriKind.Absolute), (c) => { change = c; return(true); } ); using (var tx = _stateManager.CreateTransaction()) { await d.AddAsync(tx, 1, "One"); await tx.CommitAsync(); Assert.AreEqual(1, await GetCount(d)); } change = null; await d.ClearAsync(); Assert.AreEqual(0, await GetCount(d)); Assert.IsNull(change); }