예제 #1
0
        string Render()
        {
            bundle.Renderer = fallbackRenderer.Object;
            bundle.Process(settings);
            var renderer = new ExternalStylesheetBundle.ExternalStylesheetBundleRenderer(settings);

            return(renderer.Render(bundle));
        }
        public void ProcessCallsProcessor()
        {
            var bundle = new ExternalStylesheetBundle("http://test.com/asset.css");
            var pipeline = new Mock<IBundlePipeline<StylesheetBundle>>();
            bundle.Pipeline = pipeline.Object;

            bundle.Process(new CassetteSettings());

            pipeline.Verify(p => p.Process(bundle));
        }
        public void ProcessCallsProcessor()
        {
            var bundle = new ExternalStylesheetBundle("http://test.com/asset.css");
            var processor = new Mock<IBundleProcessor<StylesheetBundle>>();
            bundle.Processor = processor.Object;

            bundle.Process(new CassetteSettings(""));

            processor.Verify(p => p.Process(bundle, It.IsAny<CassetteSettings>()));
        }
예제 #4
0
        public void ProcessCallsProcessor()
        {
            var bundle    = new ExternalStylesheetBundle("http://test.com/asset.css");
            var processor = new Mock <IBundleProcessor <StylesheetBundle> >();

            bundle.Processor = processor.Object;

            bundle.Process(new CassetteSettings(""));

            processor.Verify(p => p.Process(bundle, It.IsAny <CassetteSettings>()));
        }
예제 #5
0
        public void ProcessCallsProcessor()
        {
            var bundle   = new ExternalStylesheetBundle("http://test.com/asset.css");
            var pipeline = new Mock <IBundlePipeline <StylesheetBundle> >();

            bundle.Pipeline = pipeline.Object;

            bundle.Process(new CassetteSettings());

            pipeline.Verify(p => p.Process(bundle));
        }
예제 #6
0
        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\"");
        }
예제 #8
0
        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);
        }
예제 #10
0
 string Render()
 {
     bundle.Process(settings);
     bundle.FallbackRenderer = fallbackRenderer.Object;
     return(bundle.Render());
 }