Exemplo n.º 1
0
        public ICacheProvider Create()
        {
            var activeCacheProvider = GetActiveCacheProvider();

            if (activeCacheProvider == null)
            {
                var providerSettings = _providerSettingsConfig.GetProviders();
                var cacheProviders   = providerSettings.Select(it => _cacheProviderInstanceFactory.Create(it.Type, it.ServerSettings)).ToList();
                activeCacheProvider = GetCacheProvider(cacheProviders);
            }

            return(activeCacheProvider);
        }
 public void Should_GetProviders_FromConfigurationFile()
 {
     _providerSettingsConfig
     .GetProviders()
     .Should()
     .NotBeNull();
 }
Exemplo n.º 3
0
        public void WhenGetProviders_AndGetSectionsCallReturnNull_ShouldThrowAnException()
        {
            _mockConfigurationAdapter
            .Setup(it => it.GetSections <CacheSection>(It.IsAny <string>()))
            .Returns((CacheSection)null);

            _providerSettingsConfig.GetProviders();
        }