public async Task WriteEntry_WritesEntryToAllSourceCaches() { const string cacheKey = "test-cache-key"; const string value = "test-value"; DateTime absoluteExpiration = new DateTime(year: 2018, month: 3, day: 17, hour: 8, minute: 0, second: 0); CacheEntry <string> cacheEntry = new CacheEntry <string>(value, absoluteExpiration); Mock <ICache> sourceCache1Mock = new Mock <ICache>(MockBehavior.Strict); sourceCache1Mock .Setup(cache => cache.WriteEntry(cacheKey, cacheEntry)) .Returns(Task.CompletedTask).Verifiable(); Mock <ICache> sourceCache2Mock = new Mock <ICache>(MockBehavior.Strict); sourceCache2Mock .Setup(cache => cache.WriteEntry(cacheKey, cacheEntry)) .Returns(Task.CompletedTask).Verifiable(); CompositeCache compositeCache = new CompositeCache(new ICache[] { sourceCache1Mock.Object, sourceCache2Mock.Object }); await compositeCache.WriteEntry(cacheKey, cacheEntry); sourceCache1Mock.Verify(); sourceCache2Mock.Verify(); }