public void RenderUsesRenderer() { var bundle = new ExternalStylesheetBundle("http://test.com/asset.css"); var urlGenerator = new Mock <IUrlGenerator>(); urlGenerator.Setup(g => g.CreateBundleUrl(bundle)).Returns("/"); var settings = new CassetteSettings("") { UrlGenerator = urlGenerator.Object }; bundle.Process(settings); var html = bundle.Render(); html.ShouldContain(bundle.Url); }
public void GivenMediaNotEmpty_RenderReturnsHtmlLinkElementWithMediaAttribute() { var bundle = new ExternalStylesheetBundle("http://test.com/asset.css") { Media = "print" }; var urlGenerator = new Mock<IUrlGenerator>(); urlGenerator.Setup(g => g.CreateBundleUrl(bundle)).Returns("/"); var settings = new CassetteSettings("") { UrlGenerator = urlGenerator.Object }; bundle.Process(settings); var html = bundle.Render(); html.ShouldContain(bundle.Url); html.ShouldContain("media=\"print\""); }
public void GivenMediaNotEmpty_RenderReturnsHtmlLinkElementWithMediaAttribute() { var bundle = new ExternalStylesheetBundle("http://test.com/asset.css") { Media = "print" }; var urlGenerator = new Mock <IUrlGenerator>(); urlGenerator.Setup(g => g.CreateBundleUrl(bundle)).Returns("/"); var settings = new CassetteSettings("") { UrlGenerator = urlGenerator.Object }; bundle.Process(settings); var html = bundle.Render(); html.ShouldContain(bundle.Url); html.ShouldContain("media=\"print\""); }
public void RenderUsesRenderer() { var bundle = new ExternalStylesheetBundle("http://test.com/asset.css"); var urlGenerator = new Mock<IUrlGenerator>(); urlGenerator.Setup(g => g.CreateBundleUrl(bundle)).Returns("/"); var settings = new CassetteSettings("") { UrlGenerator = urlGenerator.Object }; bundle.Process(settings); var html = bundle.Render(); html.ShouldContain(bundle.Url); }
string Render() { bundle.Process(settings); bundle.FallbackRenderer = fallbackRenderer.Object; return(bundle.Render()); }