Пример #1
0
        public void TestContentRenderTrailingScript()
        {
            ContentBlockTrailingClientScript testContent = new ContentBlockTrailingClientScript();
            GadgetMaster master = new GadgetMaster(testFactory);
            ContentBlock block  = new ContentBlock();

            master.AddContentBlock(block);
            block.LoadTag(testContent.Source);
            block.IncludeWrappingDivs = false;

            string tagRendered = ControlTestHelper.NormalizeRenderResult(ControlTestHelper.GetRenderedContents(block));

            Assert.IsTrue(tagRendered.Length > 0, "Empty rendered tag from content");
            Assert.AreEqual(ControlTestHelper.NormalizeRenderResult(testContent.ExpectedCanvas), tagRendered);
        }
Пример #2
0
        public void TestContentRender()
        {
            GadgetMaster master = new GadgetMaster(testFactory);
            ContentBlock block  = master.AddContentBlock(new ContentBlock());

            block.LoadTag(sampleContent);

            //block.ParseContent();

            MemoryStream s = new MemoryStream(1024);
            StreamWriter w = new StreamWriter(s);

            block.Render(w);
            w.Flush();
            s.Seek(0, SeekOrigin.Begin);
            string tagRendered = ControlTestHelper.GetStreamContent(s);

            Assert.IsTrue(tagRendered.Length > 0, "Empty rendered tag from content");
        }