public void Setup() { _destinationDir = @"C:\testdir"; _artifactFileName = "file1.cs"; _teamCityCaller = A.Fake<ITeamCityCaller>(); _systemIOWrapper = A.Fake<ISystemIOWrapper>(); _testee = new ArtifactDownloader(_teamCityCaller, _systemIOWrapper); }
/// <summary> /// Gets download Urls for the associated artifacts. /// </summary> /// <param name="extractArchives"> /// If <see langword="true"/> files contained within archives will be listed individually. /// </param> /// <remarks> /// This method is only supported by TeamCity 8.x and higher. /// </remarks> public List <string> GetDownloadUrls(bool extractArchives = false) { var downloader = new ArtifactDownloader(_caller); return(downloader.GetDownloadUrls(_artifacts, _artifactRelativeName, extractArchives)); }
/// <summary> /// Downloads the associated artifacts. /// </summary> /// <param name="directory"> /// Destination directory for downloaded artifacts, default is current working directory. /// </param> /// <param name="flatten"> /// If <see langword="true"/> all files will be downloaded to destination directory, no subfolders will be created. /// </param> /// <param name="overwrite"> /// If <see langword="true"/> files that already exist where a downloaded file is to be placed will be deleted prior to download. /// </param> /// <param name="extractArchives"> /// If <see langword="true"/> files contained within archives will be downloaded individually under a directory with the archive's name. /// </param> /// <remarks> /// This method is only supported by TeamCity 8.x and higher. /// </remarks> public List<string> Download(string directory = null, bool flatten = false, bool overwrite = true, bool extractArchives = false) { var downloader = new ArtifactDownloader(_caller, new SystemIOWrapper()); return downloader.Download(_artifacts, _artifactRelativeName, directory, flatten, overwrite, extractArchives); }