public void WhenProcessBundle_ThenHashIsAssigned() { var pipeline = new ScriptPipeline(); var bundle = new ScriptBundle("~"); pipeline.Process(bundle, new CassetteSettings("")); bundle.Hash.ShouldNotBeNull(); }
public ScriptPipeline_Tests() { minifier = Mock.Of <IJavaScriptMinifier>(); urlGenerator = Mock.Of <IUrlGenerator>(); var container = new TinyIoCContainer(); settings = new CassetteSettings(); container.Register(minifier); container.Register(urlGenerator); container.Register(settings); pipeline = new ScriptPipeline(container, settings); }
public void CreateBundleAssignsSettingsDefaultProcessor() { var processor = new ScriptPipeline(); settings.SetDefaultBundleProcessor(processor); var factory = new ScriptBundleFactory(settings); var bundle = factory.CreateBundle("~", Enumerable.Empty <IFile>(), new BundleDescriptor { AssetFilenames = { "*" } }); bundle.Processor.ShouldBeSameAs(processor); }
public void GivenCompileCoffeeScriptIsTrue_WhenProcessBundle_ThenCompileAssetTransformerIsAddedToAsset() { var pipeline = new ScriptPipeline().CompileCoffeeScript(); var bundle = new ScriptBundle("~"); var asset = StubCoffeeScriptAsset(); bundle.Assets.Add(asset.Object); pipeline.Process(bundle, new CassetteSettings("")); asset.Verify(a => a.AddAssetTransformer(It.IsAny <CompileAsset>())); }
public void GivenCompileCoffeeScriptIsFalse_WhenProcessBundle_ThenCompileAssetTransformerNotAddedToAsset() { var pipeline = new ScriptPipeline { CompileCoffeeScript = false }; var bundle = new ScriptBundle("~"); var asset = StubCoffeeScriptAsset(); bundle.Assets.Add(asset.Object); pipeline.Process(bundle, new CassetteSettings()); asset.Verify(a => a.AddAssetTransformer(It.IsAny <CompileAsset>()), Times.Never()); }
public void GivenDebugMode_WhenProcessBundle_ThenRendererIsDebugScriptBundleHtmlRenderer() { var settings = new CassetteSettings { IsDebuggingEnabled = true }; var bundle = new ScriptBundle("~/test"); var pipeline = new ScriptPipeline(); pipeline.Process(bundle, settings); bundle.Renderer.ShouldBeType <DebugScriptBundleHtmlRenderer>(); }
public void CompileCoffeeScriptDefaultsToTrue() { var pipeline = new ScriptPipeline(); pipeline.CompileCoffeeScript.ShouldBeTrue(); }
public ScriptBundle(string applicationRelativePath) : base(applicationRelativePath) { ContentType = "text/javascript"; Processor = new ScriptPipeline(); }