Exemplo n.º 1
0
        public string GetJobs_DownloadFile(string rule, string file)
        {
            var artifactRule = new ArtifactRule(0, "http://example.com/download", rule);
            var jobs         = artifactRule.GetJobs(file);

            Assert.That(jobs.Count, Is.EqualTo(1));
            Assert.That(jobs[0], Is.TypeOf <DownloadFileJob>());
            var downloadJob = jobs[0] as DownloadFileJob;

            Assert.That(downloadJob.Url, Is.EqualTo("http://example.com/download/" + file));
            return(NormalizedPath(downloadJob.TargetFile));
        }
Exemplo n.º 2
0
        public void GetJobs_ZipFile()
        {
            var artifactRule = new ArtifactRule(0, "http://example.com/download", "a.zip!a/b/c/*/.dll=>dlls");
            var jobs         = artifactRule.GetJobs("a.zip");

            Assert.That(jobs.Count, Is.EqualTo(2));
            Assert.That(jobs[0], Is.TypeOf <DownloadZipJob>());
            var downloadJob = jobs[0] as DownloadZipJob;

            Assert.That(downloadJob.Url, Is.EqualTo("http://example.com/download/a.zip"));
            Assert.That(downloadJob.TargetFile, Is.EqualTo(Path("Downloads/a.zip")));
            Assert.That(jobs[1], Is.TypeOf <UnzipFilesJob>());
            var unzipJob = jobs[1] as UnzipFilesJob;

            Assert.That(unzipJob.ZipFile, Is.EqualTo(Path("Downloads/a.zip")));
            Assert.That(unzipJob.SourcePath, Is.EqualTo("a/b/c/*/.dll"));
            Assert.That(unzipJob.DestinationPath, Is.EqualTo("dlls"));
        }