Esempio n. 1
0
        public void CanCreateCachedBundle()
        {
            var tag = javaScriptBundle
                      .Add(Test1Path)
                      .AsCached("Test", currentOutputFile);

            var content = javaScriptBundle.RenderCached("Test");

            // Assert.AreEqual("<script type=\"text/javascript\" src=\"js/output_2.js?r=E36D384488ABCF73BCCE650C627FB74F\"></script>", tag);
            Assert.AreEqual(TEST1_MINIFIED, content);
        }
Esempio n. 2
0
        public void CanCreateCachedBundle()
        {
            var tag = javaScriptBundle
                      .Add("~/js/test.js")
                      .AsCached("Test", "~/js/output_2.js");

            var content = javaScriptBundle.RenderCached("Test");

            Assert.AreEqual("<script type=\"text/javascript\" src=\"js/output_2.js?r=E36D384488ABCF73BCCE650C627FB74F\"></script>", tag);
            Assert.AreEqual("function product(a,b){return a*b}function sum(a,b){return a+b}", content);
        }
        public void CanCreateCachedBundle()
        {
            var tag = javaScriptBundle
                      .Add("~/js/test.js")
                      .AsCached("Test", "~/js/output_2.js");

            var content = javaScriptBundle.RenderCached("Test");

            Assert.AreEqual("<script type=\"text/javascript\" src=\"js/output_2.js?r=36286D0CEA57C5ED24B868EB0D2898E9\"></script>", tag);
            Assert.AreEqual("function product(n,t){return n*t}function sum(n,t){return n+t}", content);
        }
        public void CanCreateCachedBundle()
        {
            var tag = javaScriptBundle
                      .Add("~/js/test.js")
                      .AsCached("Test", "~/js/output_2.js");

            var content = javaScriptBundle.RenderCached("Test");

            Assert.AreEqual("<script type=\"text/javascript\" src=\"js/output_2.js?r=36286D0CEA57C5ED24B868EB0D2898E9\"></script>", tag);
            Assert.AreEqual(minifiedJavaScript, content);
        }
        public void CanCreateCachedBundleWithForceRelease()
        {
            var tag1 = debugJavaScriptBundle
                       .Add("~/js/test.js")
                       .ForceRelease()
                       .AsCached("Test", "~/assets/js/main");

            var content = debugJavaScriptBundle.RenderCached("Test");

            javaScriptBundle.ClearCache();
            var tag2 = debugJavaScriptBundle.RenderCachedAssetTag("Test");

            Assert.AreEqual(tag1, tag2);
            Assert.AreEqual("<script type=\"text/javascript\" src=\"assets/js/main?r=36286D0CEA57C5ED24B868EB0D2898E9\"></script>", tag1);
            Assert.AreEqual(minifiedJavaScript, content);
        }