public SelfCleaningDirectory(IPostTestDirectoryRemover directoryRemover, string path) { if (Directory.Exists(path)) { throw new InvalidOperationException($"Directory '{path}' already exists."); } DirectoryPath = path; directoryRemover.Register(DirectoryPath); }
public SelfCleaningDirectory(IPostTestDirectoryRemover directoryRemover, string path) { if (Directory.Exists(path)) { throw new InvalidOperationException(string.Format("Directory '{0}' already exists.", path)); } DirectoryPath = path; directoryRemover.Register(DirectoryPath); }
public SelfCleaningDirectory(IPostTestDirectoryRemover directoryRemover, string path) { if (Directory.Exists(path)) { throw new InvalidOperationException(string.Format("Directory '{0}' already exists.", path)); } DirectoryPath = path; RootedDirectoryPath = Path.GetFullPath(path); directoryRemover.Register(DirectoryPath); }