コード例 #1
0
        public SelfCleaningDirectory(IPostTestDirectoryRemover directoryRemover, string path)
        {
            if (Directory.Exists(path))
            {
                throw new InvalidOperationException($"Directory '{path}' already exists.");
            }

            DirectoryPath = path;
            directoryRemover.Register(DirectoryPath);
        }
コード例 #2
0
    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);
    }
コード例 #3
0
        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);
        }