26 references to CustomMemoryDistributedCache2
Microsoft.Extensions.Caching.Hybrid.Tests (26)
ServiceConstructionTests.cs (26)
186services.TryAddKeyedSingleton<IDistributedCache, CustomMemoryDistributedCache2>(typeof(CustomMemoryDistributedCache2));
189services.AddKeyedHybridCache("two", options => options.DistributedCacheServiceKey = typeof(CustomMemoryDistributedCache2));
200var cacheTwoBackend = Assert.IsType<CustomMemoryDistributedCache2>(cacheTwo.BackendCache);
201Assert.Same(typeof(CustomMemoryDistributedCache2), cacheTwoOptions.DistributedCacheServiceKey);
202Assert.Same(cacheTwoBackend, provider.GetRequiredKeyedService<IDistributedCache>(typeof(CustomMemoryDistributedCache2)));
323services.AddKeyedSingleton<IDistributedCache, CustomMemoryDistributedCache2>("DistributedTwo");
327services.AddKeyedHybridCache(typeof(CustomMemoryDistributedCache2), "HybridTwo");
335var hybridTwo = Assert.IsType<DefaultHybridCache>(provider.GetRequiredKeyedService<HybridCache>(typeof(CustomMemoryDistributedCache2)));
337var hybridTwoBackend = Assert.IsType<CustomMemoryDistributedCache2>(hybridTwo.BackendCache);
344provider.GetRequiredKeyedService<HybridCache>(typeof(CustomMemoryDistributedCache2));
345provider.GetRequiredKeyedService<HybridCache>(typeof(CustomMemoryDistributedCache2));
346provider.GetRequiredKeyedService<HybridCache>(typeof(CustomMemoryDistributedCache2));
363services.AddKeyedSingleton<IDistributedCache, CustomMemoryDistributedCache2>("DistributedTwo");
375var hybridTwoBackend = Assert.IsType<CustomMemoryDistributedCache2>(hybridTwo.BackendCache);
401services.AddKeyedSingleton<IDistributedCache, CustomMemoryDistributedCache2>("DistributedTwo");
403services.AddKeyedHybridCache(typeof(CustomMemoryDistributedCache2), "HybridTwo", options => ConfigurationBinder.Bind(config, "HybridTwo", options));
411var hybridTwo = Assert.IsType<DefaultHybridCache>(provider.GetRequiredKeyedService<HybridCache>(typeof(CustomMemoryDistributedCache2)));
413var hybridTwoBackend = Assert.IsType<CustomMemoryDistributedCache2>(hybridTwo.BackendCache);
420provider.GetRequiredKeyedService<HybridCache>(typeof(CustomMemoryDistributedCache2));
421provider.GetRequiredKeyedService<HybridCache>(typeof(CustomMemoryDistributedCache2));
422provider.GetRequiredKeyedService<HybridCache>(typeof(CustomMemoryDistributedCache2));