// Analysis disable once InconsistentNaming public void GetUserCacheDir_ReturnsCachedValue_WhenXdgCacheHomeIsChanged() { var environment = new EnvironmentMock("XDG_CACHE_HOME", "/first/path/.cache"); var xdg = new XdgDirectoryService(null, environment.Object); xdg.GetUserCacheDir(); environment.SetVariable("XDG_CACHE_HOME", "/second/path/.cache"); var result = xdg.GetUserCacheDir(); Assert.AreEqual("/first/path/.cache", result); }
// Analysis disable once InconsistentNaming public void GetUserCacheDir_ReturnsHome_WhenXdgCacheHomeNotSet () { var environment = new EnvironmentMock ("HOME", "/home/user"); var xdg = new XdgDirectoryService (null, environment.Object); var result = xdg.GetUserCacheDir (); Assert.AreEqual ("/home/user/.cache", result); }
// Analysis disable once InconsistentNaming public void GetUserCacheDir_ReturnsXdgCacheHome_WhenXdgCacheHomeSet () { var environment = new EnvironmentMock ("XDG_CACHE_HOME", "/path/to/.cache"); var xdg = new XdgDirectoryService (null, environment.Object); var result = xdg.GetUserCacheDir (); Assert.AreEqual ("/path/to/.cache", result); }
// Analysis disable once InconsistentNaming public void GetUserCacheDir_ReturnsHome_WhenXdgCacheHomeNotSet() { var environment = new EnvironmentMock("HOME", "/home/user"); var xdg = new XdgDirectoryService(null, environment.Object); var result = xdg.GetUserCacheDir(); Assert.AreEqual("/home/user/.cache", result); }
// Analysis disable once InconsistentNaming public void GetUserCacheDir_ReturnsXdgCacheHome_WhenXdgCacheHomeSet() { var environment = new EnvironmentMock("XDG_CACHE_HOME", "/path/to/.cache"); var xdg = new XdgDirectoryService(null, environment.Object); var result = xdg.GetUserCacheDir(); Assert.AreEqual("/path/to/.cache", result); }
// Analysis disable once InconsistentNaming public void GetUserCacheDir_ReturnsXdgCacheHome_WhenXdgCacheHomeAndHomeAreSet() { var environment = new EnvironmentMock("XDG_CACHE_HOME", pathToCache); environment.SetVariable("HOME", homeDir); var xdg = new XdgDirectoryService(null, environment.Object); var result = xdg.GetUserCacheDir(); Assert.AreEqual(pathToCache, result); }
// Analysis disable once InconsistentNaming public void GetUserCacheDir_ReturnsCachedValue_WhenXdgCacheHomeIsChanged () { var environment = new EnvironmentMock ("XDG_CACHE_HOME", "/first/path/.cache"); var xdg = new XdgDirectoryService (null, environment.Object); xdg.GetUserCacheDir (); environment.SetVariable ("XDG_CACHE_HOME", "/second/path/.cache"); var result = xdg.GetUserCacheDir (); Assert.AreEqual ("/first/path/.cache", result); }