コード例 #1
0
        public void WhenProcessModule_ThenModuleContentTypeIsTextJavascript()
        {
            var pipeline = new KnockoutJQueryTmplPipeline();
            var module = new HtmlTemplateModule("~/");

            pipeline.Process(module, Mock.Of<ICassetteApplication>());

            module.ContentType.ShouldEqual("text/javascript");
        }
コード例 #2
0
        public void GivenAssetInSubDirectory_WhenRender_ThenScriptIdHasSlashesReplacedWithDashes()
        {
            var module = new HtmlTemplateModule("~/test");
            var asset = new Mock<IAsset>();
            asset.Setup(a => a.SourceFilename).Returns("~/test/sub/asset.htm");
            asset.Setup(a => a.OpenStream()).Returns(Stream.Null);
            module.Assets.Add(asset.Object);

            var renderer = new InlineHtmlTemplateModuleRenderer();
            var html = renderer.Render(module).ToHtmlString();

            html.ShouldContain("id=\"sub-asset\"");
        }
コード例 #3
0
 public WrapJQueryTemplateInInitializer(HtmlTemplateModule module)
 {
     this.module = module;
 }