37 references to CustomMemoryDistributedCache1
Microsoft.Extensions.Caching.Hybrid.Tests (37)
ServiceConstructionTests.cs (37)
59services.TryAddKeyedSingleton<IDistributedCache, CustomMemoryDistributedCache1>(typeof(CustomMemoryDistributedCache1)); 60services.AddHybridCache(options => options.DistributedCacheServiceKey = typeof(CustomMemoryDistributedCache1)); 66var backend = Assert.IsType<CustomMemoryDistributedCache1>(hybrid.BackendCache); 67Assert.Same(typeof(CustomMemoryDistributedCache1), hybridOptions.DistributedCacheServiceKey); 68Assert.Same(backend, provider.GetRequiredKeyedService<IDistributedCache>(typeof(CustomMemoryDistributedCache1))); 75services.AddHybridCache(options => options.DistributedCacheServiceKey = typeof(CustomMemoryDistributedCache1)); 86services.AddHybridCache(options => options.DistributedCacheServiceKey = typeof(CustomMemoryDistributedCache1)); 184services.TryAddKeyedSingleton<IDistributedCache, CustomMemoryDistributedCache1>(typeof(CustomMemoryDistributedCache1)); 187services.AddKeyedHybridCache("one", options => options.DistributedCacheServiceKey = typeof(CustomMemoryDistributedCache1)); 193var cacheOneBackend = Assert.IsType<CustomMemoryDistributedCache1>(cacheOne.BackendCache); 194Assert.Same(typeof(CustomMemoryDistributedCache1), cacheOneOptions.DistributedCacheServiceKey); 195Assert.Same(cacheOneBackend, provider.GetRequiredKeyedService<IDistributedCache>(typeof(CustomMemoryDistributedCache1))); 209services.AddSingleton<IDistributedCache, CustomMemoryDistributedCache1>(); 321services.AddKeyedSingleton<IDistributedCache, CustomMemoryDistributedCache1>("DistributedOne"); 325services.AddKeyedHybridCache(typeof(CustomMemoryDistributedCache1), "HybridOne"); 329var hybridOne = Assert.IsType<DefaultHybridCache>(provider.GetRequiredKeyedService<HybridCache>(typeof(CustomMemoryDistributedCache1))); 331var hybridOneBackend = Assert.IsType<CustomMemoryDistributedCache1>(hybridOne.BackendCache); 339provider.GetRequiredKeyedService<HybridCache>(typeof(CustomMemoryDistributedCache1)); 340provider.GetRequiredKeyedService<HybridCache>(typeof(CustomMemoryDistributedCache1)); 341provider.GetRequiredKeyedService<HybridCache>(typeof(CustomMemoryDistributedCache1)); 361services.AddKeyedSingleton<IDistributedCache, CustomMemoryDistributedCache1>("DistributedOne"); 369var hybridOneBackend = Assert.IsType<CustomMemoryDistributedCache1>(hybridOne.BackendCache); 399services.AddKeyedSingleton<IDistributedCache, CustomMemoryDistributedCache1>("DistributedOne"); 401services.AddKeyedHybridCache(typeof(CustomMemoryDistributedCache1), "HybridOne", options => ConfigurationBinder.Bind(config, "HybridOne", options)); 405var hybridOne = Assert.IsType<DefaultHybridCache>(provider.GetRequiredKeyedService<HybridCache>(typeof(CustomMemoryDistributedCache1))); 407var hybridOneBackend = Assert.IsType<CustomMemoryDistributedCache1>(hybridOne.BackendCache); 415provider.GetRequiredKeyedService<HybridCache>(typeof(CustomMemoryDistributedCache1)); 416provider.GetRequiredKeyedService<HybridCache>(typeof(CustomMemoryDistributedCache1)); 417provider.GetRequiredKeyedService<HybridCache>(typeof(CustomMemoryDistributedCache1)); 515services.AddSingleton<IDistributedCache, CustomMemoryDistributedCache1>();