Пример #1
0
        public void SimpleVarRendersInCustomTag()
        {
            GadgetVarsInCustomTemplateInstance testData = new GadgetVarsInCustomTemplateInstance();

            GadgetMaster target = new GadgetMaster(testFactory, testData.Source);

            target.RenderingOptions.ClientRenderCustomTemplates = false;
            target.RenderingOptions.DivWrapContentBlocks        = false;
            string result   = ControlTestHelper.NormalizeRenderResult(target.RenderToString("canvas"));
            string expected = ControlTestHelper.NormalizeRenderResult(testData.ExpectedCanvas);

            Assert.AreEqual(expected, result);
        }
Пример #2
0
        internal static string GetRenderedContents(GadgetMaster master, string surface)
        {
            if (master == null)
            {
                throw new ArgumentNullException("Null control");
            }

            MemoryStream output = new MemoryStream();
            TextWriter   w      = new StreamWriter(output);

            master.RenderContent(w, surface);
            w.Flush();
            string result = ControlTestHelper.GetStreamContent(output);

            return(result);
        }
Пример #3
0
        internal static string GetRenderedContents(BaseGadgetControl control)
        {
            if (control == null)
            {
                throw new ArgumentNullException("Null control");
            }

            MemoryStream output = new MemoryStream();
            TextWriter   w      = new StreamWriter(output);

            control.Render(w);
            w.Flush();
            string result = ControlTestHelper.GetStreamContent(output);

            return(result);
        }