public void GroupingMWQMSitesAndPolSourceSitesGenerateService_GenerateLinksBetweenMWQMSitesAndPolSourceSitesForCSSPWebToolsVisualization_Test()
        {
            // AppTaskID	TVItemID	TVItemID2	AppTaskCommand	AppTaskStatus	PercentCompleted	Parameters	Language	StartDateTime_UTC	EndDateTime_UTC	EstimatedLength_second	RemainingTime_second	LastUpdateDate_UTC	LastUpdateContactTVItemID
            // 12643   344316  344316  2   1   1 ||| MikeScenarioTVItemID,344316 ||| 1   2018 - 03 - 20 14:49:58.440 NULL NULL    NULL    2018 - 03 - 20 14:49:58.443 2
            foreach (LanguageEnum LanguageRequest in new List <LanguageEnum>()
            {
                LanguageEnum.en, LanguageEnum.fr
            })
            {
                SetupTest(LanguageRequest);

                int ProvinceTVItemID = 7;

                StringBuilder sbKML      = new StringBuilder();
                string        Parameters = $"|||ProvinceTVItemID,{ ProvinceTVItemID }|||";

                AppTaskModel appTaskModel = new AppTaskModel()
                {
                    AppTaskID                 = 100000,
                    TVItemID                  = ProvinceTVItemID,
                    TVItemID2                 = ProvinceTVItemID,
                    AppTaskCommand            = AppTaskCommandEnum.GenerateLinksBetweenMWQMSitesAndPolSourceSitesForCSSPWebToolsVisualization,
                    AppTaskStatus             = AppTaskStatusEnum.Created,
                    PercentCompleted          = 1,
                    Parameters                = Parameters,
                    Language                  = LanguageRequest,
                    StartDateTime_UTC         = DateTime.Now,
                    EndDateTime_UTC           = null,
                    EstimatedLength_second    = null,
                    RemainingTime_second      = null,
                    LastUpdateDate_UTC        = DateTime.Now,
                    LastUpdateContactTVItemID = 2, // Charles LeBlanc
                };

                appTaskModel.AppTaskStatus = AppTaskStatusEnum.Running;

                BWObj bwObj = new BWObj()
                {
                    Index            = 1,
                    appTaskModel     = appTaskModel,
                    appTaskCommand   = appTaskModel.AppTaskCommand,
                    TextLanguageList = new List <TextLanguage>(),
                    bw = new BackgroundWorker(),
                };

                TaskRunnerBaseService taskRunnerBaseService = new TaskRunnerBaseService(new List <BWObj>()
                {
                    bwObj
                });

                taskRunnerBaseService._BWObj = bwObj;

                GroupingMWQMSitesAndPolSourceSitesGenerateService groupingMWQMSitesAndPolSourceSitesGenerateService = new GroupingMWQMSitesAndPolSourceSitesGenerateService(taskRunnerBaseService);

                groupingMWQMSitesAndPolSourceSitesGenerateService.GenerateLinksBetweenMWQMSitesAndPolSourceSitesForCSSPWebToolsVisualization();
                Assert.AreEqual(0, taskRunnerBaseService._BWObj.TextLanguageList.Count);

                break;
            }
        }
コード例 #2
0
        public void MikeScenarioFileService_MikeScenarioImport_Test()
        {
            //        AppTaskID TVItemID    TVItemID2 AppTaskCommand  AppTaskStatus PercentCompleted    Parameters Language    StartDateTime_UTC EndDateTime_UTC EstimatedLength_second RemainingTime_second    LastUpdateDate_UTC LastUpdateContactTVItemID
            //17907   381362  381362  3   1   1 ||| TVItemID,12110 ||| UploadClientPath,E:\CSSP\Modelling\Mike21\New Brunswick\Cap - Pele\Model\Model Inputs\||| 1   2019 - 09 - 30 20:00:08.687 NULL NULL    NULL   2019 - 09 - 30 20:00:08.697 2

            foreach (LanguageEnum LanguageRequest in new List <LanguageEnum>()
            {
                LanguageEnum.en, LanguageEnum.fr
            })
            {
                SetupTest(LanguageRequest);

                int MikeScenarioTVItemID = 381362;

                string Parameters = $@"|||TVItemID,12110|||UploadClientPath,E:\CSSP\Modelling\Mike21\New Brunswick\Cap-Pele\Model\Model Inputs\|||";

                AppTaskModel appTaskModel = new AppTaskModel()
                {
                    AppTaskID                 = 100000,
                    TVItemID                  = MikeScenarioTVItemID,
                    TVItemID2                 = MikeScenarioTVItemID,
                    AppTaskCommand            = AppTaskCommandEnum.MikeScenarioImport,
                    AppTaskStatus             = AppTaskStatusEnum.Created,
                    PercentCompleted          = 1,
                    Parameters                = Parameters,
                    Language                  = LanguageRequest,
                    StartDateTime_UTC         = DateTime.Now,
                    EndDateTime_UTC           = null,
                    EstimatedLength_second    = null,
                    RemainingTime_second      = null,
                    LastUpdateDate_UTC        = DateTime.Now,
                    LastUpdateContactTVItemID = 2, // Charles LeBlanc
                };

                appTaskModel.AppTaskStatus = AppTaskStatusEnum.Running;

                BWObj bwObj = new BWObj()
                {
                    Index            = 1,
                    appTaskModel     = appTaskModel,
                    appTaskCommand   = appTaskModel.AppTaskCommand,
                    TextLanguageList = new List <TextLanguage>(),
                    bw = new BackgroundWorker(),
                };

                TaskRunnerBaseService taskRunnerBaseService = new TaskRunnerBaseService(new List <BWObj>()
                {
                    bwObj
                });

                taskRunnerBaseService._BWObj = bwObj;

                MikeScenarioFileService _MikeScenarioFileService = new MikeScenarioFileService(taskRunnerBaseService);
                _MikeScenarioFileService.MikeScenarioImportDB();
                Assert.AreEqual(0, taskRunnerBaseService._BWObj.TextLanguageList.Count);

                break;
            }
        }
        public void ClassificationGenerateService_GenerateClassificationForCSSPWebToolsVisualization_Test()
        {
            foreach (LanguageEnum LanguageRequest in new List <LanguageEnum>()
            {
                LanguageEnum.en, LanguageEnum.fr
            })
            {
                SetupTest(LanguageRequest);

                int ProvinceTVItemID = 7;

                StringBuilder sbKML      = new StringBuilder();
                string        Parameters = $"|||ProvinceTVItemID,{ ProvinceTVItemID }|||";

                AppTaskModel appTaskModel = new AppTaskModel()
                {
                    AppTaskID                 = 100000,
                    TVItemID                  = ProvinceTVItemID,
                    TVItemID2                 = ProvinceTVItemID,
                    AppTaskCommand            = AppTaskCommandEnum.GenerateClassificationForCSSPWebToolsVisualization,
                    AppTaskStatus             = AppTaskStatusEnum.Created,
                    PercentCompleted          = 1,
                    Parameters                = Parameters,
                    Language                  = LanguageRequest,
                    StartDateTime_UTC         = DateTime.Now,
                    EndDateTime_UTC           = null,
                    EstimatedLength_second    = null,
                    RemainingTime_second      = null,
                    LastUpdateDate_UTC        = DateTime.Now,
                    LastUpdateContactTVItemID = 2, // Charles LeBlanc
                };

                appTaskModel.AppTaskStatus = AppTaskStatusEnum.Running;

                BWObj bwObj = new BWObj()
                {
                    Index            = 1,
                    appTaskModel     = appTaskModel,
                    appTaskCommand   = appTaskModel.AppTaskCommand,
                    TextLanguageList = new List <TextLanguage>(),
                    bw = new BackgroundWorker(),
                };

                TaskRunnerBaseService taskRunnerBaseService = new TaskRunnerBaseService(new List <BWObj>()
                {
                    bwObj
                });

                taskRunnerBaseService._BWObj = bwObj;

                ClassificationGenerateService classificationGenerateService = new ClassificationGenerateService(taskRunnerBaseService);

                classificationGenerateService.GenerateClassificationForCSSPWebToolsVisualization();
                Assert.AreEqual(0, taskRunnerBaseService._BWObj.TextLanguageList.Count);

                break;
            }
        }
コード例 #4
0
        public void HydrometricService_LoadHydrometricDataValueDB_Test()
        {
            // AppTaskID	TVItemID	TVItemID2	AppTaskCommand	AppTaskStatus	PercentCompleted	Parameters	Language	StartDateTime_UTC	EndDateTime_UTC	EstimatedLength_second	RemainingTime_second	LastUpdateDate_UTC	LastUpdateContactTVItemID
            // 14775	361210	361210	44	2	1	|||MikeSourceTVItemID,361210|||MikeScenarioTVItemID,357139|||	1	2018-10-02 14:15:24.317	NULL	NULL	NULL	2018-10-02 14:15:25.307	2
            foreach (LanguageEnum LanguageRequest in new List <LanguageEnum>()
            {
                LanguageEnum.en, LanguageEnum.fr
            })
            {
                int MikeSourceTVItemID   = 361210;
                int MikeScenarioTVItemID = 357139;

                string Parameters = $"|||MikeSourceTVItemID,{ MikeSourceTVItemID }|||MikeScenarioTVItemID,{ MikeScenarioTVItemID }|||";

                AppTaskModel appTaskModel = new AppTaskModel()
                {
                    AppTaskID                 = 100000,
                    TVItemID                  = MikeSourceTVItemID,
                    TVItemID2                 = MikeSourceTVItemID,
                    AppTaskCommand            = AppTaskCommandEnum.LoadHydrometricDataValue,
                    AppTaskStatus             = AppTaskStatusEnum.Created,
                    PercentCompleted          = 1,
                    Parameters                = Parameters,
                    Language                  = LanguageRequest,
                    StartDateTime_UTC         = DateTime.Now,
                    EndDateTime_UTC           = null,
                    EstimatedLength_second    = null,
                    RemainingTime_second      = null,
                    LastUpdateDate_UTC        = DateTime.Now,
                    LastUpdateContactTVItemID = 2, // Charles LeBlanc
                };

                appTaskModel.AppTaskStatus = AppTaskStatusEnum.Running;

                BWObj bwObj = new BWObj()
                {
                    Index            = 1,
                    appTaskModel     = appTaskModel,
                    appTaskCommand   = appTaskModel.AppTaskCommand,
                    TextLanguageList = new List <TextLanguage>(),
                    bw = new BackgroundWorker(),
                };

                TaskRunnerBaseService taskRunnerBaseService = new TaskRunnerBaseService(new List <BWObj>()
                {
                    bwObj
                });

                taskRunnerBaseService._BWObj = bwObj;

                HydrometricService _HydrometricService = new HydrometricService(taskRunnerBaseService);

                _HydrometricService.LoadHydrometricDataValueDB();
                Assert.AreEqual(0, taskRunnerBaseService._BWObj.TextLanguageList.Count);

                break;
            }
        }
コード例 #5
0
        public void MikeScenarioFileService_MikeScenarioAskToRun_Test()
        {
            // AppTaskID TVItemID    TVItemID2 AppTaskCommand  AppTaskStatus PercentCompleted    Parameters Language    StartDateTime_UTC EndDateTime_UTC EstimatedLength_second RemainingTime_second    LastUpdateDate_UTC LastUpdateContactTVItemID
            // 14895   337049  337049  2   1   1 ||| MikeScenarioTVItemID,337049 ||| 1   2018 - 10 - 17 12:04:21.687 NULL NULL    NULL    2018 - 10 - 17 12:04:21.687 2
            foreach (LanguageEnum LanguageRequest in new List <LanguageEnum>()
            {
                LanguageEnum.en, LanguageEnum.fr
            })
            {
                SetupTest(LanguageRequest);

                int MikeScenarioTVItemID = 337049;

                string Parameters = $"|||MikeScenarioTVItemID,{ MikeScenarioTVItemID }|||";

                AppTaskModel appTaskModel = new AppTaskModel()
                {
                    AppTaskID                 = 100000,
                    TVItemID                  = MikeScenarioTVItemID,
                    TVItemID2                 = MikeScenarioTVItemID,
                    AppTaskCommand            = AppTaskCommandEnum.MikeScenarioAskToRun,
                    AppTaskStatus             = AppTaskStatusEnum.Created,
                    PercentCompleted          = 1,
                    Parameters                = Parameters,
                    Language                  = LanguageRequest,
                    StartDateTime_UTC         = DateTime.Now,
                    EndDateTime_UTC           = null,
                    EstimatedLength_second    = null,
                    RemainingTime_second      = null,
                    LastUpdateDate_UTC        = DateTime.Now,
                    LastUpdateContactTVItemID = 2, // Charles LeBlanc
                };

                appTaskModel.AppTaskStatus = AppTaskStatusEnum.Running;

                BWObj bwObj = new BWObj()
                {
                    Index            = 1,
                    appTaskModel     = appTaskModel,
                    appTaskCommand   = appTaskModel.AppTaskCommand,
                    TextLanguageList = new List <TextLanguage>(),
                    bw = new BackgroundWorker(),
                };

                TaskRunnerBaseService taskRunnerBaseService = new TaskRunnerBaseService(new List <BWObj>()
                {
                    bwObj
                });

                taskRunnerBaseService._BWObj = bwObj;

                MikeScenarioFileService _MikeScenarioFileService = new MikeScenarioFileService(taskRunnerBaseService);
                _MikeScenarioFileService.MikeScenarioAskToRun();
                Assert.AreEqual(0, taskRunnerBaseService._BWObj.TextLanguageList.Count);

                break;
            }
        }
コード例 #6
0
        public void TidesAndCurrentsService_Constructor_Test()
        {
            foreach (LanguageEnum LanguageRequest in new List <LanguageEnum>()
            {
                LanguageEnum.en, LanguageEnum.fr
            })
            {
                // Arrange
                SetupTest(LanguageRequest);
                Assert.IsNotNull(csspWebToolsTaskRunner);

                AppTaskModel appTaskModel = new AppTaskModel()
                {
                    AppTaskID                 = 100000,
                    TVItemID                  = 123456,
                    TVItemID2                 = 123456,
                    AppTaskCommand            = AppTaskCommandEnum.SetupWebTide,
                    AppTaskStatus             = AppTaskStatusEnum.Created,
                    PercentCompleted          = 1,
                    Parameters                = "|||MikeScenarioTVItemID,336888|||WebTideDataSet,11|||",
                    Language                  = LanguageRequest,
                    StartDateTime_UTC         = DateTime.Now,
                    EndDateTime_UTC           = null,
                    EstimatedLength_second    = null,
                    RemainingTime_second      = null,
                    LastUpdateDate_UTC        = DateTime.Now,
                    LastUpdateContactTVItemID = 2, // Charles LeBlanc
                };

                appTaskModel.AppTaskStatus = AppTaskStatusEnum.Running;

                BWObj bwObj = new BWObj()
                {
                    Index            = 1,
                    appTaskModel     = appTaskModel,
                    appTaskCommand   = appTaskModel.AppTaskCommand,
                    TextLanguageList = new List <TextLanguage>(),
                    bw = new BackgroundWorker(),
                };

                TaskRunnerBaseService taskRunnerBaseService = new TaskRunnerBaseService(new List <BWObj>()
                {
                    bwObj
                });

                taskRunnerBaseService._BWObj = bwObj;

                using (TransactionScope ts = new TransactionScope())
                {
                    tidesAndCurrentsService = new TidesAndCurrentsService(taskRunnerBaseService);
                    Assert.IsNotNull(tidesAndCurrentsService);
                    Assert.IsNotNull(tidesAndCurrentsService._TaskRunnerBaseService);
                    Assert.AreEqual(bwObj.appTaskModel.AppTaskID, tidesAndCurrentsService._TaskRunnerBaseService._BWObj.appTaskModel.AppTaskID);
                }
            }
        }
コード例 #7
0
        public void TidesAndCurrentsService_SetWebTide_Test()
        {
            foreach (LanguageEnum LanguageRequest in new List <LanguageEnum>()
            {
                LanguageEnum.en, LanguageEnum.fr
            })
            {
                SetupTest(LanguageRequest);

                int    MikeScenarioTVItemID = 336888;
                string Parameters           = "|||MikeScenarioTVItemID,336888|||WebTideDataSet,11|||";

                //AppTaskID	TVItemID	TVItemID2	AppTaskCommand	AppTaskStatus	PercentCompleted	Parameters	Language	StartDateTime_UTC	EndDateTime_UTC	EstimatedLength_second	RemainingTime_second	LastUpdateDate_UTC	LastUpdateContactTVItemID
                //10346	336888	336888	8	2	10	|||MikeScenarioTVItemID,336888|||WebTideDataSet,11|||	1	2018-02-12 13:16:35.400	NULL NULL    NULL	2018-02-12 13:16:36.477	2
                AppTaskModel appTaskModel = new AppTaskModel()
                {
                    AppTaskID                 = 100000,
                    TVItemID                  = MikeScenarioTVItemID,
                    TVItemID2                 = MikeScenarioTVItemID,
                    AppTaskCommand            = AppTaskCommandEnum.SetupWebTide,
                    AppTaskStatus             = AppTaskStatusEnum.Created,
                    PercentCompleted          = 1,
                    Parameters                = Parameters,
                    Language                  = LanguageRequest,
                    StartDateTime_UTC         = DateTime.Now,
                    EndDateTime_UTC           = null,
                    EstimatedLength_second    = null,
                    RemainingTime_second      = null,
                    LastUpdateDate_UTC        = DateTime.Now,
                    LastUpdateContactTVItemID = 2, // Charles LeBlanc
                };

                appTaskModel.AppTaskStatus = AppTaskStatusEnum.Running;

                BWObj bwObj = new BWObj()
                {
                    Index            = 1,
                    appTaskModel     = appTaskModel,
                    appTaskCommand   = appTaskModel.AppTaskCommand,
                    TextLanguageList = new List <TextLanguage>(),
                    bw = new BackgroundWorker(),
                };

                TaskRunnerBaseService taskRunnerBaseService = new TaskRunnerBaseService(new List <BWObj>()
                {
                    bwObj
                });

                taskRunnerBaseService._BWObj = bwObj;
                TidesAndCurrentsService tidesAndCurrentsService = new TidesAndCurrentsService(taskRunnerBaseService);

                tidesAndCurrentsService.SetupWebTide();

                break;
            }
        }
コード例 #8
0
        public void MikeScenarioFileService_MikeScenarioPrepareResults_Test()
        {
            foreach (LanguageEnum LanguageRequest in new List <LanguageEnum>()
            {
                LanguageEnum.en, LanguageEnum.fr
            })
            {
                SetupTest(LanguageRequest);

                int MikeScenarioTVItemID = 357139;

                string Parameters = $"|||MikeScenarioTVItemID,{ MikeScenarioTVItemID }|||";

                AppTaskModel appTaskModel = new AppTaskModel()
                {
                    AppTaskID                 = 100000,
                    TVItemID                  = MikeScenarioTVItemID,
                    TVItemID2                 = MikeScenarioTVItemID,
                    AppTaskCommand            = AppTaskCommandEnum.MikeScenarioPrepareResults,
                    AppTaskStatus             = AppTaskStatusEnum.Created,
                    PercentCompleted          = 1,
                    Parameters                = Parameters,
                    Language                  = LanguageRequest,
                    StartDateTime_UTC         = DateTime.Now,
                    EndDateTime_UTC           = null,
                    EstimatedLength_second    = null,
                    RemainingTime_second      = null,
                    LastUpdateDate_UTC        = DateTime.Now,
                    LastUpdateContactTVItemID = 2, // Charles LeBlanc
                };

                BWObj bwObj = new BWObj()
                {
                    Index            = 1,
                    appTaskModel     = appTaskModel,
                    appTaskCommand   = appTaskModel.AppTaskCommand,
                    TextLanguageList = new List <TextLanguage>(),
                    bw = new BackgroundWorker(),
                };

                TaskRunnerBaseService taskRunnerBaseService = new TaskRunnerBaseService(new List <BWObj>()
                {
                    bwObj
                });

                taskRunnerBaseService._BWObj = bwObj;

                MikeScenarioFileService _MikeScenarioFileService = new MikeScenarioFileService(taskRunnerBaseService);
                _MikeScenarioFileService.MikeScenarioPrepareResults();
                Assert.AreEqual(0, taskRunnerBaseService._BWObj.TextLanguageList.Count);

                break;
            }
        }
コード例 #9
0
        public void HydrometricService_UpdateHydrometricSitesInformationForProvinceTVItemID_Test()
        {
            foreach (LanguageEnum LanguageRequest in new List <LanguageEnum>()
            {
                LanguageEnum.en, LanguageEnum.fr
            })
            {
                int ProvinceTVItemID = 7;

                AppTaskModel appTaskModel = new AppTaskModel()
                {
                    AppTaskID                 = 0,
                    TVItemID                  = ProvinceTVItemID,
                    TVItemID2                 = ProvinceTVItemID,
                    AppTaskCommand            = AppTaskCommandEnum.UpdateHydrometricSiteInformation,
                    AppTaskStatus             = AppTaskStatusEnum.Created,
                    PercentCompleted          = 1,
                    Parameters                = "",
                    Language                  = LanguageRequest,
                    StartDateTime_UTC         = DateTime.Now,
                    EndDateTime_UTC           = null,
                    EstimatedLength_second    = null,
                    RemainingTime_second      = null,
                    LastUpdateDate_UTC        = DateTime.Now,
                    LastUpdateContactTVItemID = 2, // Charles LeBlanc
                };

                appTaskModel.AppTaskStatus = AppTaskStatusEnum.Running;

                BWObj bwObj = new BWObj()
                {
                    Index            = 1,
                    appTaskModel     = appTaskModel,
                    appTaskCommand   = appTaskModel.AppTaskCommand,
                    TextLanguageList = new List <TextLanguage>(),
                    bw = new BackgroundWorker(),
                };

                TaskRunnerBaseService taskRunnerBaseService = new TaskRunnerBaseService(new List <BWObj>()
                {
                    bwObj
                });

                taskRunnerBaseService._BWObj = bwObj;

                HydrometricService _HydrometricService = new HydrometricService(taskRunnerBaseService);
                _HydrometricService.UpdateHydrometricSitesInformationForProvinceTVItemID();
                Assert.AreEqual(0, taskRunnerBaseService._BWObj.TextLanguageList.Count);

                break;
            }
        }
コード例 #10
0
        public void GenerateMikeScenarioPollutionAnimationKMZ_Test()
        {
            //AppTaskID TVItemID    TVItemID2 AppTaskCommand  AppTaskStatus PercentCompleted    Parameters Language    StartDateTime_UTC EndDateTime_UTC EstimatedLength_second RemainingTime_second    LastUpdateDate_UTC LastUpdateContactTVItemID
            //10371	336990	336990	19	2	1	|||TVItemID,336925|||ReportTypeID,31|||ContourValues,14 88|||	1	2018-02-12 14:25:06.863	NULL NULL    NULL	2018-02-12 14:25:07.663	2
            foreach (LanguageEnum LanguageRequest in new List <LanguageEnum>()
            {
                LanguageEnum.en, LanguageEnum.fr
            })
            {
                SetupTest(LanguageRequest);

                int    MikeScenarioTVItemID = 336990;
                int    ReportTypeID         = 31;
                string ContourValues        = "14 88";
                int    Year = 2017;

                FileInfo        fi              = new FileInfo(@"C:\Users\leblancc\Desktop\TestHTML\TestPolSourceAnimation" + LanguageRequest.ToString() + ".kml");
                StringBuilder   sbHTML          = new StringBuilder();
                string          Parameters      = $"|||TVItemID,{ MikeScenarioTVItemID }|||ReportTypeID,{ ReportTypeID }|||ContourValues,{ ContourValues }|||";
                ReportTypeModel reportTypeModel = _ReportTypeService.GetReportTypeModelWithReportTypeIDDB(ReportTypeID);

                AppTaskModel appTaskModel = new AppTaskModel()
                {
                    AppTaskID                 = 100000,
                    TVItemID                  = MikeScenarioTVItemID,
                    TVItemID2                 = MikeScenarioTVItemID,
                    AppTaskCommand            = AppTaskCommandEnum.CreateDocumentFromParameters,
                    AppTaskStatus             = AppTaskStatusEnum.Created,
                    PercentCompleted          = 1,
                    Parameters                = Parameters,
                    Language                  = LanguageRequest,
                    StartDateTime_UTC         = DateTime.Now,
                    EndDateTime_UTC           = null,
                    EstimatedLength_second    = null,
                    RemainingTime_second      = null,
                    LastUpdateDate_UTC        = DateTime.Now,
                    LastUpdateContactTVItemID = 2, // Charles LeBlanc
                };

                appTaskModel.AppTaskStatus = AppTaskStatusEnum.Running;

                BWObj bwObj = new BWObj()
                {
                    Index            = 1,
                    appTaskModel     = appTaskModel,
                    appTaskCommand   = appTaskModel.AppTaskCommand,
                    TextLanguageList = new List <TextLanguage>(),
                    bw = new BackgroundWorker(),
                };

                TaskRunnerBaseService taskRunnerBaseService = new TaskRunnerBaseService(new List <BWObj>()
                {
                    bwObj
                });

                taskRunnerBaseService._BWObj = bwObj;
                ParametersService parameterService = new ParametersService(taskRunnerBaseService);
                parameterService.fi              = fi;
                parameterService.sb              = sbHTML;
                parameterService.Parameters      = Parameters;
                parameterService.reportTypeModel = reportTypeModel;
                parameterService.TVItemID        = MikeScenarioTVItemID;
                parameterService.Year            = Year;

                StringBuilder sbTemp  = new StringBuilder();
                bool          retBool = parameterService.GenerateMikeScenarioPollutionAnimationKMZ();
                Assert.AreEqual(true, retBool);

                StreamWriter sw = fi.CreateText();
                sw.Write(parameterService.sb.ToString());
                sw.Close();

                break;
            }
        }
コード例 #11
0
        public void FillElementLayerList_Test()
        {
            //AppTaskID TVItemID    TVItemID2 AppTaskCommand  AppTaskStatus PercentCompleted    Parameters Language    StartDateTime_UTC EndDateTime_UTC EstimatedLength_second RemainingTime_second    LastUpdateDate_UTC LastUpdateContactTVItemID
            //10371	336990	336990	19	2	1	|||TVItemID,336925|||ReportTypeID,30|||ContourValues,14 88|||	1	2018-02-12 14:25:06.863	NULL NULL    NULL	2018-02-12 14:25:07.663	2
            foreach (LanguageEnum LanguageRequest in new List <LanguageEnum>()
            {
                LanguageEnum.en, LanguageEnum.fr
            })
            {
                SetupTest(LanguageRequest);

                int    MikeScenarioTVItemID = 336990;
                int    ReportTypeID         = 30;
                string ContourValues        = "14 88";
                int    Year = 2017;

                FileInfo        fi              = new FileInfo(@"C:\Users\leblancc\Desktop\TestHTML\FillElementLayerList_" + LanguageRequest.ToString() + ".KML");
                StringBuilder   sbKML           = new StringBuilder();
                string          Parameters      = $"|||TVItemID,{ MikeScenarioTVItemID }|||ReportTypeID,{ ReportTypeID }|||CoutourValues,{ ContourValues }|||";
                ReportTypeModel reportTypeModel = _ReportTypeService.GetReportTypeModelWithReportTypeIDDB(ReportTypeID);

                AppTaskModel appTaskModel = new AppTaskModel()
                {
                    AppTaskID                 = 100000,
                    TVItemID                  = MikeScenarioTVItemID,
                    TVItemID2                 = MikeScenarioTVItemID,
                    AppTaskCommand            = AppTaskCommandEnum.CreateDocumentFromParameters,
                    AppTaskStatus             = AppTaskStatusEnum.Created,
                    PercentCompleted          = 1,
                    Parameters                = Parameters,
                    Language                  = LanguageRequest,
                    StartDateTime_UTC         = DateTime.Now,
                    EndDateTime_UTC           = null,
                    EstimatedLength_second    = null,
                    RemainingTime_second      = null,
                    LastUpdateDate_UTC        = DateTime.Now,
                    LastUpdateContactTVItemID = 2, // Charles LeBlanc
                };

                appTaskModel.AppTaskStatus = AppTaskStatusEnum.Running;

                BWObj bwObj = new BWObj()
                {
                    Index            = 1,
                    appTaskModel     = appTaskModel,
                    appTaskCommand   = appTaskModel.AppTaskCommand,
                    TextLanguageList = new List <TextLanguage>(),
                    bw = new BackgroundWorker(),
                };

                TaskRunnerBaseService taskRunnerBaseService = new TaskRunnerBaseService(new List <BWObj>()
                {
                    bwObj
                });

                taskRunnerBaseService._BWObj = bwObj;
                ParametersService parameterService = new ParametersService(taskRunnerBaseService);
                parameterService.fi              = fi;
                parameterService.sb              = sbKML;
                parameterService.Parameters      = Parameters;
                parameterService.reportTypeModel = reportTypeModel;
                parameterService.TVItemID        = MikeScenarioTVItemID;
                parameterService.Year            = Year;

                DfsuFile            dfsuFile            = null;
                List <Element>      elementList         = new List <Element>();
                List <ElementLayer> elementLayerList    = new List <ElementLayer>();
                List <NodeLayer>    topNodeLayerList    = new List <NodeLayer>();
                List <NodeLayer>    bottomNodeLayerList = new List <NodeLayer>();
                List <Node>         nodeList            = new List <Node>();

                dfsuFile = parameterService.GetTransportDfsuFile();
                Assert.IsNotNull(dfsuFile);
                Assert.AreEqual(0, taskRunnerBaseService._BWObj.TextLanguageList.Count);

                StringBuilder sbTemp  = new StringBuilder();
                bool          retBool = parameterService.FillRequiredList(dfsuFile, elementList, elementLayerList, nodeList, topNodeLayerList, bottomNodeLayerList);
                Assert.AreEqual(true, retBool);
                Assert.AreEqual(15829, nodeList.Count);
                Assert.AreEqual(22340, elementLayerList.Count);
                Assert.AreEqual(22340, elementList.Count);

                try
                {
                    dfsuFile.Close();
                }
                catch (Exception)
                {
                    // nothing
                }

                break;
            }
        }
        public void Public_Generate_FC_SummaryStatistics_Test()
        {
            //AppTaskID	TVItemID	TVItemID2	AppTaskCommand	AppTaskStatus	PercentCompleted	Parameters	Language	StartDateTime_UTC	EndDateTime_UTC	EstimatedLength_second	RemainingTime_second	LastUpdateDate_UTC	LastUpdateContactTVItemID
            //18044	778	778	19	2	10	|||TVItemID,778|||ReportTypeID,23|||Year,2019|||	1	2019-10-10 11:59:59.993	NULL NULL    NULL	2019-10-10 12:00:03.653	2
            //
            foreach (LanguageEnum LanguageRequest in new List <LanguageEnum>()
            {
                LanguageEnum.en, LanguageEnum.fr
            })
            {
                SetupTest(LanguageRequest);

                int SubsectorTVItemID = 778;
                int ReportTypeID      = 23;
                int Year = 2019;

                //FileInfo fi = new FileInfo(@"C:\Users\leblancc\Desktop\TestHTML\PublicGenerateReEvaluation_" + LanguageRequest.ToString() + ".html");
                //StringBuilder sbHTML = new StringBuilder();
                string          Parameters      = $"|||TVItemID,{ SubsectorTVItemID }|||ReportTypeID,{ ReportTypeID }|||Year,{ Year }|||";
                ReportTypeModel reportTypeModel = _ReportTypeService.GetReportTypeModelWithReportTypeIDDB(ReportTypeID);
                AppTaskModel    appTaskModel    = new AppTaskModel()
                {
                    AppTaskID                 = 10000,
                    TVItemID                  = SubsectorTVItemID,
                    TVItemID2                 = SubsectorTVItemID,
                    AppTaskCommand            = AppTaskCommandEnum.CreateDocumentFromParameters,
                    AppTaskStatus             = AppTaskStatusEnum.Created,
                    PercentCompleted          = 1,
                    Parameters                = Parameters,
                    Language                  = LanguageRequest,
                    StartDateTime_UTC         = DateTime.Now,
                    EndDateTime_UTC           = null,
                    EstimatedLength_second    = null,
                    RemainingTime_second      = null,
                    LastUpdateDate_UTC        = DateTime.Now,
                    LastUpdateContactTVItemID = 2, // Charles LeBlanc
                };

                appTaskModel.AppTaskStatus = AppTaskStatusEnum.Running;

                BWObj bwObj = new BWObj()
                {
                    Index            = 1,
                    appTaskModel     = appTaskModel,
                    appTaskCommand   = appTaskModel.AppTaskCommand,
                    TextLanguageList = new List <TextLanguage>(),
                    bw = new BackgroundWorker(),
                };

                TaskRunnerBaseService taskRunnerBaseService = new TaskRunnerBaseService(new List <BWObj>()
                {
                    bwObj
                });

                taskRunnerBaseService._BWObj = bwObj;
                ParametersService parameterService = new ParametersService(taskRunnerBaseService);
                //parameterService.fi = fi;
                //parameterService.sb = sbHTML;
                //parameterService.Parameters = Parameters;
                //parameterService.reportTypeModel = reportTypeModel;
                //parameterService.TVItemID = SubsectorTVItemID;
                //parameterService.Year = Year;
                //StringBuilder sbTemp = new StringBuilder();

                parameterService.Generate();
                Assert.AreEqual(0, taskRunnerBaseService._BWObj.TextLanguageList.Count);

                //StreamWriter sw = fi.CreateText();
                //sw.Write(sbTemp.ToString());
                //sw.Flush();
                //sw.Close();
            }
        }
        public void PublicGenerateHTMLSUBSECTOR_MWQM_SITES_FC_TABLE_Test()
        {
            foreach (LanguageEnum LanguageRequest in new List <LanguageEnum>()
            {
                LanguageEnum.en, LanguageEnum.fr
            })
            {
                SetupTest(LanguageRequest);

                int SubsectorTVItemID = 776;
                int ReportTypeID      = 23;
                int Year = 2019;

                FileInfo        fi              = new FileInfo(@"C:\Users\leblancc\Desktop\TestHTML\PublicGenerateHTMLSUBSECTOR_MWQM_SITES_FC_TABLE" + LanguageRequest.ToString() + ".html");
                StringBuilder   sbHTML          = new StringBuilder();
                string          Parameters      = $"|||TVItemID,{ SubsectorTVItemID }|||ReportTypeID,{ ReportTypeID }|||Year,{ Year }|||";
                ReportTypeModel reportTypeModel = _ReportTypeService.GetReportTypeModelWithReportTypeIDDB(ReportTypeID);
                AppTaskModel    appTaskModel    = new AppTaskModel()
                {
                    AppTaskID                 = 10000,
                    TVItemID                  = SubsectorTVItemID,
                    TVItemID2                 = SubsectorTVItemID,
                    AppTaskCommand            = AppTaskCommandEnum.CreateDocumentFromParameters,
                    AppTaskStatus             = AppTaskStatusEnum.Created,
                    PercentCompleted          = 1,
                    Parameters                = Parameters,
                    Language                  = LanguageRequest,
                    StartDateTime_UTC         = DateTime.Now,
                    EndDateTime_UTC           = null,
                    EstimatedLength_second    = null,
                    RemainingTime_second      = null,
                    LastUpdateDate_UTC        = DateTime.Now,
                    LastUpdateContactTVItemID = 2, // Charles LeBlanc
                };

                appTaskModel.AppTaskStatus = AppTaskStatusEnum.Running;

                BWObj bwObj = new BWObj()
                {
                    Index            = 1,
                    appTaskModel     = appTaskModel,
                    appTaskCommand   = appTaskModel.AppTaskCommand,
                    TextLanguageList = new List <TextLanguage>(),
                    bw = new BackgroundWorker(),
                };

                TaskRunnerBaseService taskRunnerBaseService = new TaskRunnerBaseService(new List <BWObj>()
                {
                    bwObj
                });

                taskRunnerBaseService._BWObj = bwObj;
                ParametersService parameterService = new ParametersService(taskRunnerBaseService);
                parameterService.fi              = fi;
                parameterService.sb              = sbHTML;
                parameterService.Parameters      = Parameters;
                parameterService.reportTypeModel = reportTypeModel;
                parameterService.TVItemID        = SubsectorTVItemID;
                parameterService.Year            = Year;
                StringBuilder sbTemp = new StringBuilder();

                bool retBool = parameterService.PublicGenerateHTMLSUBSECTOR_MWQM_SITES_FC_TABLE(sbTemp);
                Assert.AreEqual(true, retBool);

                StreamWriter sw = fi.CreateText();
                sw.Write(sbTemp.ToString());
                sw.Flush();
                sw.Close();

                break;
            }
        }
コード例 #14
0
        public void HydrometricService_GetHydrometricSiteDataForYear_Test()
        {
            // AppTaskID	TVItemID	TVItemID2	AppTaskCommand	AppTaskStatus	PercentCompleted	Parameters	Language	StartDateTime_UTC	EndDateTime_UTC	EstimatedLength_second	RemainingTime_second	LastUpdateDate_UTC	LastUpdateContactTVItemID
            // 14775	361210	361210	44	2	1	|||MikeSourceTVItemID,361210|||MikeScenarioTVItemID,357139|||	1	2018-10-02 14:15:24.317	NULL	NULL	NULL	2018-10-02 14:15:25.307	2
            foreach (LanguageEnum LanguageRequest in new List <LanguageEnum>()
            {
                LanguageEnum.en, LanguageEnum.fr
            })
            {
                SetupTest(LanguageRequest);

                int MikeSourceTVItemID   = 361210;
                int MikeScenarioTVItemID = 357139;

                string Parameters = $"|||MikeSourceTVItemID,{ MikeSourceTVItemID }|||MikeScenarioTVItemID,{ MikeScenarioTVItemID }|||";

                AppTaskModel appTaskModel = new AppTaskModel()
                {
                    AppTaskID                 = 100000,
                    TVItemID                  = MikeSourceTVItemID,
                    TVItemID2                 = MikeSourceTVItemID,
                    AppTaskCommand            = AppTaskCommandEnum.LoadHydrometricDataValue,
                    AppTaskStatus             = AppTaskStatusEnum.Created,
                    PercentCompleted          = 1,
                    Parameters                = Parameters,
                    Language                  = LanguageRequest,
                    StartDateTime_UTC         = DateTime.Now,
                    EndDateTime_UTC           = null,
                    EstimatedLength_second    = null,
                    RemainingTime_second      = null,
                    LastUpdateDate_UTC        = DateTime.Now,
                    LastUpdateContactTVItemID = 2, // Charles LeBlanc
                };

                appTaskModel.AppTaskStatus = AppTaskStatusEnum.Running;

                BWObj bwObj = new BWObj()
                {
                    Index            = 1,
                    appTaskModel     = appTaskModel,
                    appTaskCommand   = appTaskModel.AppTaskCommand,
                    TextLanguageList = new List <TextLanguage>(),
                    bw = new BackgroundWorker(),
                };

                TaskRunnerBaseService taskRunnerBaseService = new TaskRunnerBaseService(new List <BWObj>()
                {
                    bwObj
                });

                taskRunnerBaseService._BWObj = bwObj;

                HydrometricService _HydrometricService = new HydrometricService(taskRunnerBaseService);

                _HydrometricService.FedStationNameToDo    = "02ZJ001"; // HydrometricTVItemID = 56367;
                _HydrometricService.DataTypeToDo          = "Flow";
                _HydrometricService.YearToDo              = 2015;
                _HydrometricService.HydrometricSiteIDToDo = 288;

                HydrometricSiteModel hydrometricSiteModel = hydrometricSiteService.GetHydrometricSiteModelWithHydrometricSiteTVItemIDDB(56367);

                string url = string.Format(_HydrometricService.UrlToGetHydrometricSiteDataForYear, _HydrometricService.FedStationNameToDo, _HydrometricService.DataTypeToDo, _HydrometricService.YearToDo);

                ChromeOptions chromeOptions = new ChromeOptions();
                chromeOptions.AddArgument("headless");
                using (IWebDriver driver = new ChromeDriver()) // chromeOptions))
                {
                    _HydrometricService.GetHydrometricSiteDataForYear(driver, hydrometricSiteModel, _HydrometricService.DataTypeToDo, _HydrometricService.YearToDo);
                    Assert.AreEqual(0, taskRunnerBaseService._BWObj.TextLanguageList.Count);
                }

                break;
            }
        }
コード例 #15
0
        public void MikeScenarioFileService_CreateInititalConditionFileSalAndTempFromTVFileItemID_Test()
        {
            foreach (LanguageEnum LanguageRequest in new List <LanguageEnum>()
            {
                LanguageEnum.en, LanguageEnum.fr
            })
            {
                SetupTest(LanguageRequest);

                int MikeScenarioTVItemID = 357139;

                string Parameters = $"|||not important|||";

                AppTaskModel appTaskModel = new AppTaskModel()
                {
                    AppTaskID                 = 100000,
                    TVItemID                  = MikeScenarioTVItemID,
                    TVItemID2                 = MikeScenarioTVItemID,
                    AppTaskCommand            = AppTaskCommandEnum.Error,
                    AppTaskStatus             = AppTaskStatusEnum.Error,
                    PercentCompleted          = 1,
                    Parameters                = Parameters,
                    Language                  = LanguageRequest,
                    StartDateTime_UTC         = DateTime.Now,
                    EndDateTime_UTC           = null,
                    EstimatedLength_second    = null,
                    RemainingTime_second      = null,
                    LastUpdateDate_UTC        = DateTime.Now,
                    LastUpdateContactTVItemID = 2, // Charles LeBlanc
                };

                appTaskModel.AppTaskStatus = AppTaskStatusEnum.Running;

                BWObj bwObj = new BWObj()
                {
                    Index            = 1,
                    appTaskModel     = appTaskModel,
                    appTaskCommand   = appTaskModel.AppTaskCommand,
                    TextLanguageList = new List <TextLanguage>(),
                    bw = new BackgroundWorker(),
                };

                TaskRunnerBaseService taskRunnerBaseService = new TaskRunnerBaseService(new List <BWObj>()
                {
                    bwObj
                });

                taskRunnerBaseService._BWObj = bwObj;

                MikeScenarioFileService _MikeScenarioFileService = new MikeScenarioFileService(taskRunnerBaseService);

                TVItemModel tvItemModelMikeScenario = _TVItemService.GetTVItemModelWithTVItemIDDB(MikeScenarioTVItemID);
                Assert.AreEqual("", tvItemModelMikeScenario.Error);

                MikeScenarioModel mikeScenarioModel = _MikeScenarioService.GetMikeScenarioModelWithMikeScenarioTVItemIDDB(MikeScenarioTVItemID);
                Assert.AreEqual("", mikeScenarioModel.Error);

                TVFileModel tvFileModelM21_3FM = _TVFileService.GetTVFileModelWithTVItemIDAndTVFileTypeM21FMOrM3FMDB(MikeScenarioTVItemID);
                Assert.AreEqual("", tvFileModelM21_3FM.Error);

                string ServerPath = _TVFileService.GetServerFilePath(MikeScenarioTVItemID);

                FileInfo fiM21_M3 = new FileInfo(ServerPath + tvFileModelM21_3FM.ServerFileName);
                Assert.AreEqual(true, fiM21_M3.Exists);

                _MikeScenarioFileService.CreateInititalConditionFileSalAndTempFromTVFileItemID(MikeScenarioTVItemID, (int)mikeScenarioModel.UseSalinityAndTemperatureInitialConditionFromTVFileTVItemID, fiM21_M3);
                Assert.AreEqual(0, taskRunnerBaseService._BWObj.TextLanguageList.Count);

                break;
            }
        }