Exemple #1
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="dep">Dependency represented by this instance</param>
 /// <param name="isCached">Cache settings for the dependency</param>
 public HealthCheck(Dependency dep, CacheSettings cacheSettings)
 {
     attachedDependency = dep;
     cache = cacheSettings;
     cacheSettings.Validate();
     cacheManager = InMemoryCache.GetInstance;
 }
Exemple #2
0
        public void CachingDisabledNegativeCacheEnabled()
        {
            CacheSettings settings = new CacheSettings()
            {
                Cache           = false,
                NegativeCache   = true,
                CacheTTLSeconds = 60,
                Name            = "ABC"
            };

            Assert.Throws(typeof(InvalidOperationException), () => settings.Validate());
            Assert.Throws(typeof(InvalidOperationException), () => new CertificateCache(settings));
        }