private static string GetDirectoryName() { ReportGroup reportGroup = TestReportCreate.GetMonthReportGroup(); ReportFileBase file = new MonitorReportFile(reportGroup); return(Path.GetDirectoryName(file.ReportInfo.FullName)); }
public void ReportInfoTest() { ReportGroup reportGroup = GetMonthReportGroup(); ReportFileBase file = new MonitorReportFile(reportGroup); Assert.IsTrue(CheckReportInfo(reportGroup, file.ReportInfo)); }
public void TestGetTemplateHandleFullPath() { string templateHandleRootDirPath = Path.GetFullPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, TemplateHandleRootDirPath)); string handlePath = MonitorReportFile.GetTemplateHandlePath(templateHandleRootDirPath, "PhShouLianWeeklyReport"); Assert.IsTrue(File.Exists(handlePath)); }
public void DailyReportFileByExcelTest() { ReportGroup reportGroup = GetDailyReportGroup(); ReportFileBase file = new MonitorReportFile(reportGroup); ReportTaskResult result = file.CreateNewFile(); Assert.IsTrue(CheckResult(reportGroup, result)); }
public static string CallTemplateHandle(TemplateHandlerPrams para, string handleName) { const string method = "WriteFile"; string dependPath = Path.GetFullPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, DependPath)); string templateHandleRootDirPath = Path.GetFullPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, TemplateHandleRootDirPath)); string templateHandlePath = MonitorReportFile.GetTemplateHandlePath(templateHandleRootDirPath, handleName); var cp = new object[] { para }; CrossDomainCompiler.Call(templateHandlePath, dependPath, typeof(TemplateHandleBase), method, ref cp); return(para.FileFullName); }
public void TestSaveAndDeleteReportInfo() { ReportGroup reportGroup = TestReportCreate.GetMonthReportGroup(); ReportFileBase file = new MonitorReportFile(reportGroup); Assert.IsTrue(ReportConfigDal.SaveReportInfo(file.ReportInfo)); int fileRec; using (var db = new DW_iSecureCloud_EmptyEntities()) { fileRec = db.T_REPORT_COLLECTION.Where(r => r.Name == file.ReportInfo.Name).ToList().Count; } Assert.IsTrue(fileRec > 0); Assert.IsTrue(ReportConfigDal.DeleteOldReportInfo(file.ReportInfo.Name)); using (var db = new DW_iSecureCloud_EmptyEntities()) { fileRec = db.T_REPORT_COLLECTION.Where(r => r.FileFullName == file.ReportInfo.FullName).ToList().Count; } Assert.IsTrue(fileRec == 0); }