public void TestGetCacheHome_hasXdgCacheHome() { Mock.Get(mockEnvironment).Setup(e => e.GetEnvironmentVariable("XDG_CACHE_HOME")).Returns(fakeCacheHome); Assert.AreEqual( Paths.Get(fakeCacheHome), UserCacheHome.GetCacheHome(mockEnvironment)); }
public void TestGetCacheHome_linux() { Mock.Get(mockEnvironment).Setup(e => e.GetFolderPath(Environment.SpecialFolder.UserProfile)) .Returns(fakeCacheHome); Assert.AreEqual( Paths.Get(fakeCacheHome, ".cache"), UserCacheHome.GetCacheHome(mockEnvironment)); }
public void TestGetCacheHome_windows() { Mock.Get(mockEnvironment).Setup(e => e.GetFolderPath(Environment.SpecialFolder.UserProfile)) .Returns("nonexistent"); Mock.Get(mockEnvironment).Setup(e => e.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)) .Returns(fakeCacheHome); Assert.AreEqual( Paths.Get(fakeCacheHome), UserCacheHome.GetCacheHome(mockEnvironment)); }
public void TestGetCacheHome_mac() { SystemPath libraryApplicationSupport = Paths.Get(fakeCacheHome, "Library", "Application Support"); Files.CreateDirectories(libraryApplicationSupport); Mock.Get(mockEnvironment).Setup(e => e.GetFolderPath(Environment.SpecialFolder.UserProfile)) .Returns(fakeCacheHome); Mock.Get(mockEnvironment).Setup(e => e.IsOsx()).Returns(true); Assert.AreEqual( libraryApplicationSupport, UserCacheHome.GetCacheHome(mockEnvironment)); }