Ejemplo n.º 1
0
        public void GetRepoPaths_usesCacheIfAvailable()
        {
            var currentPath  = "C:\\testZZZ\\badYYY\\folderNNN";
            var cacheFolders = new RepoPaths {
                CurrentPath = currentPath
            };
            var cacheKey = "REF" + currentPath + "\\";

            _cacheManager.Get <RepoPaths>(cacheKey).Returns(cacheFolders);

            DWPSUtils._diskManager = _diskManager;

            var result = _gitUtils.GetRepoPaths(currentPath, false);

            _cacheManager.Received(1).Get <RepoPaths>(cacheKey);
            Assert.IsNotNull(result);
            Assert.AreEqual(result.CurrentPath, currentPath);
            Assert.IsFalse(result.IgnoreCache);
        }