Inheritance: IDisposable
コード例 #1
0
 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}");
         }
     }
 }
コード例 #2
0
 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(){}");
         }
     }
 }
コード例 #3
0
 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(){}");
         }
     }
 }
コード例 #4
0
 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}");
         }
     }
 }
コード例 #5
0
        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() {
}");
                }
            }
        }
コード例 #6
0
        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() {
            }");
                }
            }
        }
コード例 #7
0
        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"));
                }
            }
        }
コード例 #8
0
        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"));
                }
            }
        }
コード例 #9
0
 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}");
         }
     }
 }
コード例 #10
0
 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");
         }
     }
 }
コード例 #11
0
        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"));
                }
            }
        }