37 references to CustomMemoryDistributedCache1
Microsoft.Extensions.Caching.Hybrid.Tests (37)
ServiceConstructionTests.cs (37)
60services.TryAddKeyedSingleton<IDistributedCache, CustomMemoryDistributedCache1>(typeof(CustomMemoryDistributedCache1)); 61services.AddHybridCache(options => options.DistributedCacheServiceKey = typeof(CustomMemoryDistributedCache1)); 67var backend = Assert.IsType<CustomMemoryDistributedCache1>(hybrid.BackendCache); 68Assert.Same(typeof(CustomMemoryDistributedCache1), hybridOptions.DistributedCacheServiceKey); 69Assert.Same(backend, provider.GetRequiredKeyedService<IDistributedCache>(typeof(CustomMemoryDistributedCache1))); 76services.AddHybridCache(options => options.DistributedCacheServiceKey = typeof(CustomMemoryDistributedCache1)); 87services.AddHybridCache(options => options.DistributedCacheServiceKey = typeof(CustomMemoryDistributedCache1)); 185services.TryAddKeyedSingleton<IDistributedCache, CustomMemoryDistributedCache1>(typeof(CustomMemoryDistributedCache1)); 188services.AddKeyedHybridCache("one", options => options.DistributedCacheServiceKey = typeof(CustomMemoryDistributedCache1)); 194var cacheOneBackend = Assert.IsType<CustomMemoryDistributedCache1>(cacheOne.BackendCache); 195Assert.Same(typeof(CustomMemoryDistributedCache1), cacheOneOptions.DistributedCacheServiceKey); 196Assert.Same(cacheOneBackend, provider.GetRequiredKeyedService<IDistributedCache>(typeof(CustomMemoryDistributedCache1))); 210services.AddSingleton<IDistributedCache, CustomMemoryDistributedCache1>(); 322services.AddKeyedSingleton<IDistributedCache, CustomMemoryDistributedCache1>("DistributedOne"); 326services.AddKeyedHybridCache(typeof(CustomMemoryDistributedCache1), "HybridOne"); 330var hybridOne = Assert.IsType<DefaultHybridCache>(provider.GetRequiredKeyedService<HybridCache>(typeof(CustomMemoryDistributedCache1))); 332var hybridOneBackend = Assert.IsType<CustomMemoryDistributedCache1>(hybridOne.BackendCache); 340provider.GetRequiredKeyedService<HybridCache>(typeof(CustomMemoryDistributedCache1)); 341provider.GetRequiredKeyedService<HybridCache>(typeof(CustomMemoryDistributedCache1)); 342provider.GetRequiredKeyedService<HybridCache>(typeof(CustomMemoryDistributedCache1)); 362services.AddKeyedSingleton<IDistributedCache, CustomMemoryDistributedCache1>("DistributedOne"); 370var hybridOneBackend = Assert.IsType<CustomMemoryDistributedCache1>(hybridOne.BackendCache); 400services.AddKeyedSingleton<IDistributedCache, CustomMemoryDistributedCache1>("DistributedOne"); 402services.AddKeyedHybridCache(typeof(CustomMemoryDistributedCache1), "HybridOne", options => ConfigurationBinder.Bind(config, "HybridOne", options)); 406var hybridOne = Assert.IsType<DefaultHybridCache>(provider.GetRequiredKeyedService<HybridCache>(typeof(CustomMemoryDistributedCache1))); 408var hybridOneBackend = Assert.IsType<CustomMemoryDistributedCache1>(hybridOne.BackendCache); 416provider.GetRequiredKeyedService<HybridCache>(typeof(CustomMemoryDistributedCache1)); 417provider.GetRequiredKeyedService<HybridCache>(typeof(CustomMemoryDistributedCache1)); 418provider.GetRequiredKeyedService<HybridCache>(typeof(CustomMemoryDistributedCache1)); 516services.AddSingleton<IDistributedCache, CustomMemoryDistributedCache1>();