string TransformToHtml()
        {
            var transformer = new WrapHtmlTemplateInScriptElement(bundle, new HtmlTemplateIdBuilder(pathSeparatorReplacement: "-"));
            var getResult   = transformer.Transform(() => templateContent.AsStream(), asset.Object);
            var html        = getResult().ReadToEnd();

            return(html);
        }
Пример #2
0
        string TransformToHtml()
        {
            var transformer = new WrapHtmlTemplateInScriptElement(bundle);
            var getResult   = transformer.Transform(() => templateContent.AsStream(), asset.Object);
            var html        = getResult().ReadToEnd();

            return(html);
        }
        public void GivenAssetInSubDirectory_WhenTransform_ThenScriptIdHasSlashesReplacedWithDashes()
        {
            var bundle = new HtmlTemplateBundle("~/test");
            var asset = new Mock<IAsset>();
            asset.Setup(a => a.SourceFile.FullPath).Returns("~/test/sub/asset.htm");
            bundle.Assets.Add(asset.Object);

            var transformer = new WrapHtmlTemplateInScriptElement(bundle);
            var getResult = transformer.Transform(() => Stream.Null, asset.Object);
            var html = getResult().ReadToEnd();

            html.ShouldContain("id=\"sub-asset\"");
        }
        public void GivenAssetInSubDirectory_WhenTransform_ThenScriptIdHasSlashesReplacedWithDashes()
        {
            var bundle = new HtmlTemplateBundle("~/test");
            var asset  = new Mock <IAsset>();

            asset.Setup(a => a.SourceFile.FullPath).Returns("~/test/sub/asset.htm");
            bundle.Assets.Add(asset.Object);

            var transformer = new WrapHtmlTemplateInScriptElement(bundle);
            var getResult   = transformer.Transform(() => Stream.Null, asset.Object);
            var html        = getResult().ReadToEnd();

            html.ShouldContain("id=\"sub-asset\"");
        }
 string TransformToHtml()
 {
     var transformer = new WrapHtmlTemplateInScriptElement(bundle, new HtmlTemplateIdBuilder(pathSeparatorReplacement: "-"));
     var getResult = transformer.Transform(() => templateContent.AsStream(), asset.Object);
     var html = getResult().ReadToEnd();
     return html;
 }
 string TransformToHtml()
 {
     var transformer = new WrapHtmlTemplateInScriptElement(bundle);
     var getResult = transformer.Transform(() => templateContent.AsStream(), asset.Object);
     var html = getResult().ReadToEnd();
     return html;
 }