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();
            }
        }
Ejemplo n.º 2
0
        public void KmzService_GenerateMikeScenarioEstimatedDroguePathsAnimationKMZ_Test()
        {
            AppTaskModel appTaskModel = new AppTaskModel();

            appTaskModel.AppTaskID        = 17384;
            appTaskModel.TVItemID         = 28475;
            appTaskModel.TVItemID2        = 28475;
            appTaskModel.AppTaskCommand   = AppTaskCommandEnum.CreateDocumentFromParameters;
            appTaskModel.AppTaskStatus    = AppTaskStatusEnum.Created;
            appTaskModel.PercentCompleted = 1;
            appTaskModel.Parameters       = @"|||TVItemID,28475|||ReportTypeID,43|||DoFirstXDroguePoints,1|||Delays,0,1,2,3,4,5,6,7,8|||Layers,1|||GoogleEarthPath,!!!!!?xml version=""1.0"" encoding=""UTF-8""?@@@@@" +
                                            @"!!!!!kml xmlns=""http://www.opengis.net/kml/2.2"" xmlns:gx=""http://www.google.com/kml/ext/2.2"" xmlns:kml=""http://www.opengis.net/kml/2.2"" xmlns:atom=""http://www.w3.org/2005/Atom""@@@@@" +
                                            @"!!!!!Document@@@@@" +
                                            @" !!!!!name@@@@@KmlFile!!!!!/name@@@@@" +
                                            @" !!!!!Style id=""s_ylw-pushpin_hl""@@@@@" +
                                            @"  !!!!!IconStyle@@@@@" +
                                            @"   !!!!!scale@@@@@1.3!!!!!/scale@@@@@" +
                                            @"   !!!!!Icon@@@@@" +
                                            @"    !!!!!href@@@@@http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png!!!!!/href@@@@@" +
                                            @"   !!!!!/Icon@@@@@" +
                                            @"   !!!!!hotSpot x=""20"" y=""2"" xunits=""pixels"" yunits=""pixels""/@@@@@" +
                                            @"  !!!!!/IconStyle@@@@@" +
                                            @" !!!!!/Style@@@@@" +
                                            @" !!!!!Style id=""s_ylw-pushpin""@@@@@" +
                                            @"  !!!!!IconStyle@@@@@" +
                                            @"   !!!!!scale@@@@@1.1!!!!!/scale@@@@@" +
                                            @"   !!!!!Icon@@@@@" +
                                            @"    !!!!!href@@@@@http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png!!!!!/href@@@@@" +
                                            @"   !!!!!/Icon@@@@@" +
                                            @"   !!!!!hotSpot x=""20"" y=""2"" xunits=""pixels"" yunits=""pixels""/@@@@@" +
                                            @"  !!!!!/IconStyle@@@@@" +
                                            @" !!!!!/Style@@@@@" +
                                            @" !!!!!StyleMap id=""m_ylw-pushpin""@@@@@" +
                                            @"  !!!!!Pair@@@@@" +
                                            @"   !!!!!key@@@@@normal!!!!!/key@@@@@" +
                                            @"   !!!!!styleUrl@@@@@#s_ylw-pushpin!!!!!/styleUrl@@@@@" +
                                            @"  !!!!!/Pair@@@@@" +
                                            @"  !!!!!Pair@@@@@" +
                                            @"   !!!!!key@@@@@highlight!!!!!/key@@@@@" +
                                            @"   !!!!!styleUrl@@@@@#s_ylw-pushpin_hl!!!!!/styleUrl@@@@@" +
                                            @"  !!!!!/Pair@@@@@" +
                                            @" !!!!!/StyleMap@@@@@" +
                                            @" !!!!!Placemark@@@@@" +
                                            @"  !!!!!name@@@@@Untitled Path!!!!!/name@@@@@" +
                                            @"  !!!!!styleUrl@@@@@#m_ylw-pushpin!!!!!/styleUrl@@@@@" +
                                            @"  !!!!!LineString@@@@@" +
                                            @"   !!!!!tessellate@@@@@1!!!!!/tessellate@@@@@" +
                                            @"   !!!!!coordinates@@@@@" +
                                            @"    -64.70513588369528%%%%%46.4717867228814%%%%%0 -64.69737256625811%%%%%46.47342948729938%%%%%0 " +
                                            @"   !!!!!/coordinates@@@@@" +
                                            @"  !!!!!/LineString@@@@@" +
                                            @" !!!!!/Placemark@@@@@" +
                                            @"!!!!!/Document@@@@@" +
                                            @"!!!!!/kml@@@@@" +
                                            @" |||";

            appTaskModel.Language                  = LanguageEnum.en;
            appTaskModel.StartDateTime_UTC         = new DateTime(2019, 8, 21, 17, 2, 15);
            appTaskModel.EndDateTime_UTC           = null;
            appTaskModel.EstimatedLength_second    = null;
            appTaskModel.RemainingTime_second      = null;
            appTaskModel.LastUpdateDate_UTC        = new DateTime(2019, 8, 21, 17, 4, 17);
            appTaskModel.LastUpdateContactTVItemID = 2;


            // Generated files will be located
            // \inetpub\wwwroot\csspwebtools\App_Data\28475
            foreach (string LanguageRequest in new List <string>()
            {
                "en"                                                    /*, "fr"*/
            })
            {
                csspWebToolsTaskRunner._TaskRunnerBaseService._BWObj = new BWObj()
                {
                    appTaskCommand   = AppTaskCommandEnum.CreateDocumentFromParameters,
                    appTaskModel     = appTaskModel,
                    bw               = null,
                    Index            = 0,
                    TextLanguageList = new List <TextLanguage>(),
                };

                ParametersService parametersService = new ParametersService(csspWebToolsTaskRunner._TaskRunnerBaseService);
                parametersService.Generate();
                if (csspWebToolsTaskRunner._TaskRunnerBaseService._BWObj.TextLanguageList.Count == 0)
                {
                    int ThereWasAnError = 34;
                }
                else
                {
                    int EverythingOK = 34;
                }
            }
        }