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);
        }
        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");
        }
        public void TestParseOffsets()
        {
            GadgetMaster master = new GadgetMaster(testFactory);
            ContentBlock block  = new ContentBlock();

            block.MyRootMaster = master;
            block.LoadTag(sampleContent);

            //bool done = block.Parse();
            //Assert.IsTrue(done);
            OffsetList offsets = block.MyOffset.ChildOffsets;

            Assert.AreEqual(2, offsets.Count, "Incorrect offset count");

            Assert.IsTrue("DataScript" == offsets[0].OffsetKey, "Data script not found as first item");
            Assert.IsTrue("TemplateScript" == offsets[1].OffsetKey, "Template script not second item");

            for (int i = 0; i < offsets.Count; i++)
            {
                Assert.IsTrue(offsets[i].Position > 0, String.Format("Offset {0} is negatively positioned", i));
            }
        }