Пример #1
0
        public void Validate_Load_When_Clearing_Cache()
        {
            var logger      = Substitute.For <ILogger>();
            var broker      = Substitute.For <IBroker>();
            var cacheFolder = Keys.TryGetConfigValue(Keys.CacheDir, "Cache");

            if (!Directory.Exists(cacheFolder))
            {
                Directory.CreateDirectory(cacheFolder);
            }

            File.WriteAllText(Path.Combine(cacheFolder, "test1.tst"), "abc");
            File.WriteAllText(Path.Combine(cacheFolder, "test2.tst"), "abc");

            var cachingProvider = new CachingProvider(logger, broker);

            cachingProvider.ClearCache();

            Directory.GetFiles(cacheFolder).Length.Should().Be(0);
        }
Пример #2
0
 public void ClearCache(string scope)
 {
     CachingProvider.ClearCache(scope);
     _logger.LogInformation("CACHE_CLEAR:Scope:" + scope);
 }
Пример #3
0
 public void ClearCache()
 {
     CachingProvider.ClearCache();
     //log the cache clear event
     _logger.LogInformation("CACHE_REFRESH");
 }