public void SetCurrentDirectory_WithDirectory_SetsEnvironmentVariable() { const string newCwd = @"C:\"; var path = new WindowsPath(newCwd); using (path.SetCurrentDirectory()) { Assert.AreEqual(newCwd, Environment.CurrentDirectory); } }
public void SetCurrentDirectory_UponDispose_RestoresEnvironmentVariable() { var oldCwd = Environment.CurrentDirectory; var path = new WindowsPath(@"C:\"); var tmp = path.SetCurrentDirectory(); tmp.Dispose(); Assert.AreEqual(oldCwd, Environment.CurrentDirectory); }