RenderScriptElementCollection() public method

Renders the script element collection for thes kin key.
public RenderScriptElementCollection ( string skinKey ) : string
skinKey string The skin key.
return string
Exemplo n.º 1
0
        public void ScriptElementCollectionRendererRendersScriptElements()
        {
            UnitTestHelper.SetHttpContextWithBlogRequest("localhost", "blog", string.Empty);

            var pathProvider = new Mock<VirtualPathProvider>();
            pathProvider.SetupSkins();
            var skinEngine = new SkinEngine(pathProvider.Object);
            var renderer = new ScriptElementCollectionRenderer(skinEngine);
            string scriptElements = renderer.RenderScriptElementCollection("RedBook-Green.css");

            string script = @"<script type=""text/javascript"" src=""/Skins/RedBook/blah.js""></script>";
            Assert.IsTrue(scriptElements.Contains(script), "Rendered the script improperly.");

            scriptElements = renderer.RenderScriptElementCollection("Nature-Leafy.css");
            script = @"<script type=""text/javascript"" src=""/scripts/XFNHighlighter.js""></script>";
            Assert.IsTrue(scriptElements.Contains(script), "Rendered the script improperly. We got: " + scriptElements);
        }
Exemplo n.º 2
0
        public void ScriptElementCollectionRendererRendersJSHandlerScript()
        {
            UnitTestHelper.SetHttpContextWithBlogRequest("localhost", "blog", string.Empty);

            var pathProvider = new Mock<VirtualPathProvider>();
            pathProvider.SetupSkins();
            var skinEngine = new SkinEngine(pathProvider.Object);

            var renderer = new ScriptElementCollectionRenderer(skinEngine);
            string scriptElements = renderer.RenderScriptElementCollection("RedBook-Blue.css");

            string script =
                @"<script type=""text/javascript"" src=""/Skins/RedBook/js.axd?name=RedBook-Blue.css""></script>";
            Assert.IsTrue(scriptElements.Contains(script), "Rendered the script improperly.");
        }
Exemplo n.º 3
0
        public void ScriptElementCollectionRendererRendersJSHandlerScript()
        {
            UnitTestHelper.SetHttpContextWithBlogRequest("localhost", "blog", string.Empty);
            MockRepository mocks = new MockRepository();

            VirtualPathProvider pathProvider = GetTemplatesPathProviderMock(mocks);
            mocks.ReplayAll();

            SkinTemplateCollection templates = new SkinTemplateCollection(pathProvider);
            ScriptElementCollectionRenderer renderer = new ScriptElementCollectionRenderer(templates);
            string scriptElements = renderer.RenderScriptElementCollection("RedBook-Blue.css");

            Console.WriteLine(scriptElements);

            string script = @"<script type=""text/javascript"" src=""/Skins/RedBook/js.axd?name=RedBook-Blue.css""></script>";
            Assert.IsTrue(scriptElements.IndexOf(script) > -1, "Rendered the script improperly.");
        }