private static string GetDirectoryName()
        {
            ReportGroup    reportGroup = TestReportCreate.GetMonthReportGroup();
            ReportFileBase file        = new MonitorReportFile(reportGroup);

            return(Path.GetDirectoryName(file.ReportInfo.FullName));
        }
示例#2
0
        public void ReportInfoTest()
        {
            ReportGroup    reportGroup = GetMonthReportGroup();
            ReportFileBase file        = new MonitorReportFile(reportGroup);

            Assert.IsTrue(CheckReportInfo(reportGroup, file.ReportInfo));
        }
示例#3
0
        public void TestGetTemplateHandleFullPath()
        {
            string templateHandleRootDirPath = Path.GetFullPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, TemplateHandleRootDirPath));
            string handlePath = MonitorReportFile.GetTemplateHandlePath(templateHandleRootDirPath, "PhShouLianWeeklyReport");

            Assert.IsTrue(File.Exists(handlePath));
        }
示例#4
0
        public void DailyReportFileByExcelTest()
        {
            ReportGroup      reportGroup = GetDailyReportGroup();
            ReportFileBase   file        = new MonitorReportFile(reportGroup);
            ReportTaskResult result      = file.CreateNewFile();

            Assert.IsTrue(CheckResult(reportGroup, result));
        }
示例#5
0
        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);
        }
示例#6
0
        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);
        }