public void Archive_additional_files() { AddFile(); report.Reports.Enqueue(new FakeReport()); var file = report.ArchFile(report.BuildResultFile())[0]; var files = LsZip(file); Assert.That(files.Count(), Is.EqualTo(2)); Assert.That(files[1], Is.EqualTo("Rep1.xls")); Assert.That(files[0], Is.EqualTo("description.xls")); }
public void TestArchBase() { var gr = new GeneralReport(); gr.NoArchive = true; gr.Reports.Enqueue(new FakeReport()); var file = gr.ArchFile(gr.BuildResultFile())[0]; Assert.That(Path.GetExtension(file), Is.EqualTo(".xls")); gr = new GeneralReport(); gr.Reports.Enqueue(new FakeReport()); file = gr.ArchFile(gr.BuildResultFile())[0]; Assert.That(Path.GetExtension(file), Is.EqualTo(".zip")); }
public void Arhive_per_file() { var files = new[] { "tmp/1.dbf", "tmp/2.dbf" }; FileHelper.InitDir("tmp"); FileHelper.Touch(files); var report = new GeneralReport(); report.ReportArchName = "test.zip"; report.WorkDir = "tmp"; report.MailPerFile = true; var result = report.ArchFile(files); Assert.AreEqual("tmp/1.zip, tmp/2.zip", result.Implode()); Assert.AreEqual("1.dbf", LsZip("tmp/1.zip").Implode()); }