public void GetFullCachePath(ImageSizeType imageSize)
        {
            var cacheDir              = Path.Combine("home", "homePhotos", "cache");
            var cacheFilePath         = Path.Combine("c1", "983767D2-96B3-4372-89D1-74C190EE23B0.jpg");
            var expectedFullCachePath = Path.Combine(cacheDir, "c1", imageSize.ToString(), "983767D2-96B3-4372-89D1-74C190EE23B0.jpg");

            _dynamicConfig.SetupGet(o => o.CacheFolder).Returns(cacheDir);

            var actualFullCachePath = _imageService.GetFullCachePath(cacheFilePath, imageSize);

            _dynamicConfig.VerifyGet(o => o.CacheFolder, Times.Once);

            Assert.Equal(expectedFullCachePath, actualFullCachePath);
        }
Beispiel #2
0
        public string GetFullCachePath(string cachePath, ImageSizeType imageType)
        {
            var dir = Path.Combine(_dynamicConfig.CacheFolder, Path.GetDirectoryName(cachePath), imageType.ToString());

            _fileSystemService.CreateDirectory(dir);

            return(Path.Combine(dir, Path.GetFileNameWithoutExtension(cachePath) + Path.GetExtension(cachePath)));
        }