public void PopulateGraphicsTest()
        {
            var document = new UnitTestDocument();

            document.MockPageCount = 5;
            var template = new BaseTemplate();

            template.CoverPageTitle    = "a cover page";
            template.CoverPageImageUrl = "http://mockUrl";
            template.LogoTitle         = "a logo";
            template.LogoImageUrl      = "http://mockUrl";

            var view   = new UnitTestDocumentView();
            var target = new InsuranceRenewealReportPresenter(document, view);

            target.PopulateGraphics(template, String.Empty, String.Empty);
            Assert.IsNotNull(document.ImageAltText[0]);
            Assert.IsNotNull(document.ImageAltText[1]);
            Assert.IsNotNull(document.ImageUrl[0]);
            Assert.IsNotNull(document.ImageUrl[1]);

            target.PopulateGraphics(template, "previousCoverPage", String.Empty);
            Assert.IsNotNull(document.ImageAltText[0]);
            Assert.IsNotNull(document.ImageAltText[1]);
            Assert.IsNotNull(document.ImageUrl[0]);
            Assert.IsNotNull(document.ImageUrl[1]);

            target.PopulateGraphics(template, String.Empty, "previous Logo");
            Assert.IsNotNull(document.ImageAltText[0]);
            Assert.IsNotNull(document.ImageAltText[1]);
            Assert.IsNotNull(document.ImageUrl[0]);
            Assert.IsNotNull(document.ImageUrl[1]);

            target.PopulateGraphics(template, "Previous Cover Page", "previous Logo");
            Assert.IsNotNull(document.ImageAltText[0]);
            Assert.IsNotNull(document.ImageAltText[1]);
            Assert.IsNotNull(document.ImageUrl[0]);
            Assert.IsNotNull(document.ImageUrl[1]);

            target.PopulateGraphics(template, "a cover page", "a logo");
            Assert.IsNull(document.ImageAltText[0]);
            Assert.IsNull(document.ImageAltText[1]);
            Assert.IsNull(document.ImageUrl[0]);
            Assert.IsNull(document.ImageUrl[1]);


            target.PopulateGraphics(template, "a cover page", "something here");
            Assert.IsNull(document.ImageAltText[0]);
            Assert.IsNotNull(document.ImageAltText[1]);
            Assert.IsNull(document.ImageUrl[0]);
            Assert.IsNotNull(document.ImageUrl[1]);

            target.PopulateGraphics(template, "somerthing here", "a logo");
            Assert.IsNotNull(document.ImageAltText[0]);
            Assert.IsNull(document.ImageAltText[1]);
            Assert.IsNotNull(document.ImageUrl[0]);
            Assert.IsNull(document.ImageUrl[1]);
        }
        private void PopulateDocument()
        {
            var template = GenerateTempalteObject();

            //change the graphics selected
            //if (Streams == null) return;
            _presenter.PopulateGraphics(template, lblCoverPageTitle.Text, lblLogoTitle.Text);

            if (_loadType == Helpers.Enums.FormLoadType.RibbonClick)
            {
                LogUsage(template, Helpers.Enums.UsageTrackingType.UpdateData);
                _presenter.PopulateData(template);
                return;
            }

            //popualte the basis of cover sections
            _presenter.PopulateBasisOfCover(_selectedDocumentFragments, Settings.Default.FragmentClassOfInsurance);



            var segmentDocuments = new Dictionary <Enums.Segment, string>
            {
                { Enums.Segment.One, String.Empty },
                { Enums.Segment.Two, Settings.Default.FragmentServicePlanSeg2 },
                { Enums.Segment.Three, Settings.Default.FragmentServicePlanSeg3 },
                { Enums.Segment.Four, Settings.Default.FragmentServicePlanSeg4 },
                { Enums.Segment.Five, Settings.Default.FragmentServicePlanSeg5 },
                { Enums.Segment.PersonalLines, String.Empty }
            };

            //remove basis of covers that have been unticked.
            // _presenter.RemoveBasisOfCover(_unslectedDocumentFragements);

            //populate service level segments
            _presenter.PopulateServiceLineAgrement(_selectedSegment, segmentDocuments, dtpPeriodOfInsuranceFrom.Value);

            _presenter.PopulatePurposeOfReport(_selectedSegment, Settings.Default.FragmentRRPurposeReport23,
                                               Settings.Default.FragmentRRPurposeReport45);

            //build remuneration documents
            var remunerationDocuments = new List <DocumentFragment>
            {
                new DocumentFragment
                {
                    Title = Enums.Remuneration.Fee.ToString(),
                    Url   = Settings.Default.FragementFeesRemuneration
                },
                new DocumentFragment
                {
                    Title = Enums.Remuneration.Combined.ToString(),
                    Url   = Settings.Default.FragementFeesCommission
                },
                new DocumentFragment
                {
                    Title = Enums.Remuneration.Commission.ToString(),
                    Url   = String.Empty
                }
            };

            _presenter.PopulateRemuneration(_selectedRemuneration, remunerationDocuments);

            _presenter.PopulateExecutiveSummary(_selectedRemuneration, Settings.Default.FragmentRREexSumFeeCommission,
                                                Settings.Default.FragmentRREexSumFeeCombine);

            _presenter.PopulateImportantNotices(_selectedStatutory, Settings.Default.FragmentStatutory,
                                                Settings.Default.FragmentPrivacy, Settings.Default.FragmentFSG,
                                                Settings.Default.FragmentTermsOfEngagement);
            _presenter.PopulateUFI(_populateUFI, Settings.Default.FragmentUFI);

            _presenter.PopulatePremiumSummary(_selectedDocumentFragments);

            if (rdoClitProfileYes.Checked)
            {
                _presenter.PopulateclientProfile(Settings.Default.FragmentClientProfile);
            }

            //TODO get this when IT is ready
            //if (_populateUFI)
            //_presenter.SendUFIMessage(template);

            //populate the content controls
            //populate data should be called last, as it ensures any inserted fragments get their controls populated.
            _presenter.PopulateData(template);

            _presenter.MoveToStartOfDocument();

            //tracking
            LogUsage(template,
                     _loadType == Helpers.Enums.FormLoadType.RegenerateTemplate
                         ? Helpers.Enums.UsageTrackingType.RegenerateDocument
                         : Helpers.Enums.UsageTrackingType.NewDocument);
        }