public async void GetAsyncWithDataRetriever_LocalCacheHasValue_DistributedCacheAndDataRetrieverShouldNotBeCalled() { var(hybridProvider, localProvider, fakeDistributedProvider, _) = CreateCachingProviderWithFakes(); var dataRetriever = CreateFakeAsyncDataRetriever(result: "value"); localProvider.Set("key", "cachedValue", Expiration); var res = await hybridProvider.GetAsync("key", dataRetriever, Expiration); Assert.True(res.HasValue); Assert.Equal("cachedValue", res.Value); var cachedValue = localProvider.Get <string>("key"); Assert.True(cachedValue.HasValue); Assert.Equal("cachedValue", cachedValue.Value); A.CallTo(() => dataRetriever.Invoke()).MustNotHaveHappened(); fakeDistributedProvider.CallToGetAsyncWithDataRetriever <string>().MustNotHaveHappened(); A.CallTo(() => fakeDistributedProvider.GetExpirationAsync("key")).MustNotHaveHappened(); }