public void Render()
        {
            IResourceUrl resourceUrl = MockRepository.GenerateStub <IResourceUrl>();

            resourceUrl.Stub(stub => stub.GetUrl()).Return("myStylesheetUrl.js");

            var javaScriptInclude = new StyleSheetImportRule(resourceUrl);

            javaScriptInclude.Render(_htmlHelper.Writer);

            Assert.That(_htmlHelper.GetDocumentText(), Is.EqualTo("@import url(\"myStylesheetUrl.js\");\r\n"));
        }
Exemplo n.º 2
0
        public void Render()
        {
            IResourceUrl resourceUrl = MockRepository.GenerateStub <IResourceUrl>();

            resourceUrl.Stub(stub => stub.GetUrl()).Return("myScriptUrl.js");

            var javaScriptInclude = new JavaScriptInclude(resourceUrl);

            javaScriptInclude.Render(_htmlHelper.Writer);

            var document = _htmlHelper.GetResultDocument();
            var element  = _htmlHelper.GetAssertedChildElement(document, "script", 0);

            _htmlHelper.AssertAttribute(element, "type", "text/javascript");
            _htmlHelper.AssertAttribute(element, "src", "myScriptUrl.js");
        }