public void CanGetStylesheetBundleA() { using (CreateApplication(bundles => bundles.AddPerSubDirectory<StylesheetBundle>("Styles"))) { using (var http = new HttpTestHarness(routes)) { http.Get("~/_cassette/stylesheetbundle/styles/bundle-a"); http.ResponseOutputStream.ReadToEnd().ShouldEqual("a{color:red}p{border:1px solid red}body{color:#abc}"); } } }
public void CanGetScriptBundleB() { using (CreateApplication(bundles => bundles.AddPerSubDirectory <ScriptBundle>("Scripts"))) { using (var http = new HttpTestHarness(routes)) { http.Get("~/_cassette/scriptbundle/scripts/bundle-b"); http.ResponseOutputStream.ReadToEnd().ShouldEqual("function asset3(){}"); } } }
public void CanGetScriptBundleB() { using (CreateApplication(bundles => bundles.AddPerSubDirectory<ScriptBundle>("Scripts"))) { using (var http = new HttpTestHarness(routes)) { http.Get("~/_cassette/scriptbundle/scripts/bundle-b"); http.ResponseOutputStream.ReadToEnd().ShouldEqual("function asset3(){}"); } } }
public void CanGetStylesheetBundleB() { using (CreateApplication(bundles => bundles.AddPerSubDirectory <StylesheetBundle>("Styles", b => b.Processor = new StylesheetPipeline().CompileSass()))) { using (var http = new HttpTestHarness(routes)) { http.Get("~/_cassette/stylesheetbundle/styles/bundle-b"); http.ResponseOutputStream.ReadToEnd().ShouldEqual("body{color:blue}"); } } }
public void CanGetAsset() { using (CreateApplication(bundles => bundles.AddPerSubDirectory <ScriptBundle>("Scripts"))) { using (var http = new HttpTestHarness(routes)) { http.Get("~/_cassette/asset/scripts/bundle-a/asset-1.js?123"); http.ResponseOutputStream.ReadToEnd().ShouldEqual(@"/// <reference path=""asset-2.js""/> function asset1() { }"); } } }
public void GivenDebugMode_ThenCanGetAsset() { using (CreateApplication(bundles => bundles.AddPerSubDirectory<ScriptBundle>("Scripts"), isDebuggingEnabled: true)) { using (var http = new HttpTestHarness(routes)) { http.Get("~/_cassette/asset/scripts/bundle-a/asset-1.js?123"); http.ResponseOutputStream.ReadToEnd().ShouldEqual(@"/// <reference path=""asset-2.js""/> function asset1() { }"); } } }
public void GetCoffeeScriptAssetReturnsItCompiledInToJavaScript() { using (CreateApplication(bundles => bundles.AddPerSubDirectory <ScriptBundle>("Scripts"))) { using (var http = new HttpTestHarness(routes)) { http.Get("~/_cassette/asset/scripts/bundle-c/asset.coffee?123"); http.ResponseOutputStream.ReadToEnd().ShouldEqual(@"(function() { var x; x = 1; }).call(this); ".Replace("\r\n", "\n")); } } }
public void GivenDebugMode_ThenGetCoffeeScriptAssetReturnsItCompiledInToJavaScript() { using (CreateApplication( bundles => bundles.AddPerSubDirectory <ScriptBundle>("Scripts", b => b.Processor = new ScriptPipeline().CompileCoffeeScript()), isDebuggingEnabled: true)) { using (var http = new HttpTestHarness(routes)) { http.Get("~/_cassette/asset/scripts/bundle-c/asset.coffee?123"); http.ResponseOutputStream.ReadToEnd().ShouldEqual(@"(function() { var x; x = 1; }).call(this); ".Replace("\r\n", "\n")); } } }
public void CanGetStylesheetBundleB() { using (CreateApplication(bundles => bundles.AddPerSubDirectory<StylesheetBundle>("Styles"))) { using (var http = new HttpTestHarness(routes)) { http.Get("~/_cassette/stylesheetbundle/styles/bundle-b"); http.ResponseOutputStream.ReadToEnd().ShouldEqual("body{color:blue}"); } } }
public void MhtmlStylesheetHasCorrectContentType() { using (CreateApplication(bundles => bundles.Add<StylesheetBundle>("Styles", b => b.Processor = new StylesheetPipeline().EmbedImages(ImageEmbedType.Mhtml)))) { using (var http = new HttpTestHarness(routes)) { http.Get("~/_cassette/stylesheetbundle/styles"); Assert.Equal<string>(http.Response.Object.ContentType,"message/rfc822"); } } }
public void GivenDebugMode_ThenGetCoffeeScriptAssetReturnsItCompiledInToJavaScript() { using (CreateApplication(bundles => bundles.AddPerSubDirectory<ScriptBundle>("Scripts"), isDebuggingEnabled: true)) { using (var http = new HttpTestHarness(routes)) { http.Get("~/_cassette/asset/scripts/bundle-c/asset.coffee?123"); http.ResponseOutputStream.ReadToEnd().ShouldEqual(@"(function() { var x; x = 1; }).call(this); ".Replace("\r\n", "\n")); } } }