Пример #1
0
    public TargetTest(ITestOutputHelper output)
    {
        _output             = output;
        _temporaryDirectory = new TemporaryDirectory();

        var build = _temporaryDirectory.SubDir("build");
        var files = _temporaryDirectory.SubDir("files");
        var tasks = _temporaryDirectory.SubDir("tasks").SubDir("netstandard2.0");

        _temporaryDirectory.Create();

        // Populate temporary build folder.
        var directory = new DirectoryInfo(Path.Combine(_assemblyLocation, "build"));

        foreach (var file in directory.GetFiles())
        {
            file.CopyTo(Path.Combine(build.Root, file.Name), overwrite: true);
        }
        directory = new DirectoryInfo(Path.Combine(_assemblyLocation, "TestProjects", "build"));
        foreach (var file in directory.GetFiles())
        {
            file.CopyTo(Path.Combine(build.Root, file.Name), overwrite: true);
        }

        // Populate temporary files folder.
        directory = new DirectoryInfo(Path.Combine(_assemblyLocation, "TestProjects", "files"));
        foreach (var file in directory.GetFiles())
        {
            file.CopyTo(Path.Combine(files.Root, file.Name), overwrite: true);
        }

        // Populate temporary tasks folder.
        directory = new DirectoryInfo(_assemblyLocation);
        foreach (var file in directory.GetFiles("Microsoft.Extensions.ApiDescription.Client.???"))
        {
            file.CopyTo(Path.Combine(tasks.Root, file.Name), overwrite: true);
        }
    }