public static ReturnMsg<string> Print(PrintData data) { string template = System.IO.Path.Combine(SettingConfig.TemplatePath, data.template); if (!File.Exists(template)) { Downloader.DownLoadTemplate(new string[] { data.template }); } IGenPrinter printer = new GenPrinter(); ReportGenConfig printerConfig = new ReportGenConfig() { NumberOfCopies = SettingConfig.Copy, Printer = SettingConfig.PrinterName, PrinterType = SettingConfig.PrinterType, Template = template }; return printer.Print(data.dataset, printerConfig); }
public void PrintTest() { string dnKey = "DN2013012820571"; PrintData data; IRestDelivery restDelivery = new RestDelivery(); data = restDelivery.DnItemPrintData(dnKey,200); IGenPrinter target = new GenPrinter(); ReportGenConfig printerConfig = new ReportGenConfig() { NumberOfCopies = SettingConfig.Copy, Printer = SettingConfig.PrinterName, PrinterType = SettingConfig.PrinterType, Template = Path.Combine(SettingConfig.TemplatePath, data.template) }; ReturnMsg<string> actual; actual = target.Print(data.dataset, printerConfig); Assert.AreEqual(true, actual.result); }
public void GenPrinterConstructorTest() { GenPrinter target = new GenPrinter(); Assert.Inconclusive("TODO: 实现用来验证目标的代码"); }