public void GetPageAssemblyInfo_SinglePageAssemblyInstruction_XMLFileNotExixts_Test()
 {
     using (HttpSimulator httpSimulator = GetStandardSimulatedRequest())
     {
         IPageAssemblyInstruction      actual   = PageAssemblyInstructionFactory.GetPageAssemblyInfo("/cancertopics2");
         SinglePageAssemblyInstruction expected = GetCancerTopicsSinglePageAssemblyInstuction();
         Assert.AreNotEqual(expected, actual);
     }
 }
Ejemplo n.º 2
0
        public void Page_Load(object sender, EventArgs e)
        {
            // FIX THIS COMMENT
            SinglePageAssemblyInstruction basePage = PageAssemblyContext.Current.PageAssemblyInstruction as SinglePageAssemblyInstruction;

            if (basePage == null)
            {
                return;
            }

            BlogSeriesArchiveSettings blogSeriesArchiveSettings = ModuleObjectFactory <BlogSeriesArchiveSettings> .GetModuleObject(SnippetInfo.Data);

            // initialize the control
            var    language     = PageAssemblyContext.Current.PageAssemblyInstruction.Language;
            string years        = blogSeriesArchiveSettings.Years;
            string groupBy      = blogSeriesArchiveSettings.GroupBy;
            string blogMainPage = blogSeriesArchiveSettings.BlogMainPage;
            string blogSeriesId = "Blog Series-" + blogSeriesArchiveSettings.BlogSeriesId;

            theControl = new BlogSeriesArchiveControl(language, groupBy, blogMainPage);

            // load the shortname from settings

            if (blogSeriesArchiveSettings != null)
            {
                // do not configure the control if no shortname available
                if (String.IsNullOrEmpty(years))
                {
                    return;
                }
            }

            var results = BlogArchiveDataManager.Execute(blogSeriesId, Int32.Parse(years));

            theControl.results = results;

            // add the control
            this.Controls.Add(theControl);
        }