26 references to CustomMemoryDistributedCache2
Microsoft.Extensions.Caching.Hybrid.Tests (26)
ServiceConstructionTests.cs (26)
185services.TryAddKeyedSingleton<IDistributedCache, CustomMemoryDistributedCache2>(typeof(CustomMemoryDistributedCache2)); 188services.AddKeyedHybridCache("two", options => options.DistributedCacheServiceKey = typeof(CustomMemoryDistributedCache2)); 199var cacheTwoBackend = Assert.IsType<CustomMemoryDistributedCache2>(cacheTwo.BackendCache); 200Assert.Same(typeof(CustomMemoryDistributedCache2), cacheTwoOptions.DistributedCacheServiceKey); 201Assert.Same(cacheTwoBackend, provider.GetRequiredKeyedService<IDistributedCache>(typeof(CustomMemoryDistributedCache2))); 322services.AddKeyedSingleton<IDistributedCache, CustomMemoryDistributedCache2>("DistributedTwo"); 326services.AddKeyedHybridCache(typeof(CustomMemoryDistributedCache2), "HybridTwo"); 334var hybridTwo = Assert.IsType<DefaultHybridCache>(provider.GetRequiredKeyedService<HybridCache>(typeof(CustomMemoryDistributedCache2))); 336var hybridTwoBackend = Assert.IsType<CustomMemoryDistributedCache2>(hybridTwo.BackendCache); 343provider.GetRequiredKeyedService<HybridCache>(typeof(CustomMemoryDistributedCache2)); 344provider.GetRequiredKeyedService<HybridCache>(typeof(CustomMemoryDistributedCache2)); 345provider.GetRequiredKeyedService<HybridCache>(typeof(CustomMemoryDistributedCache2)); 362services.AddKeyedSingleton<IDistributedCache, CustomMemoryDistributedCache2>("DistributedTwo"); 374var hybridTwoBackend = Assert.IsType<CustomMemoryDistributedCache2>(hybridTwo.BackendCache); 400services.AddKeyedSingleton<IDistributedCache, CustomMemoryDistributedCache2>("DistributedTwo"); 402services.AddKeyedHybridCache(typeof(CustomMemoryDistributedCache2), "HybridTwo", options => ConfigurationBinder.Bind(config, "HybridTwo", options)); 410var hybridTwo = Assert.IsType<DefaultHybridCache>(provider.GetRequiredKeyedService<HybridCache>(typeof(CustomMemoryDistributedCache2))); 412var hybridTwoBackend = Assert.IsType<CustomMemoryDistributedCache2>(hybridTwo.BackendCache); 419provider.GetRequiredKeyedService<HybridCache>(typeof(CustomMemoryDistributedCache2)); 420provider.GetRequiredKeyedService<HybridCache>(typeof(CustomMemoryDistributedCache2)); 421provider.GetRequiredKeyedService<HybridCache>(typeof(CustomMemoryDistributedCache2));