Ejemplo n.º 1
0
        public void CanIncludeDynamicContentInDebug()
        {
            var context = new Mock <HttpContextBase>();
            var request = new Mock <HttpRequestBase>();

            request.SetupGet(r => r.Url).Returns(new Uri("http://example.com"));
            context.SetupGet(c => c.Request).Returns(request.Object);

            using (new HttpContextScope(context.Object))
            {
                javaScriptBundle
                .ForceDebug()
                .AddDynamic("/some/dynamic/js");
            }

            var tag = javaScriptBundle
                      .Render("~/combined_#.js");

            Assert.AreEqual(0, fileWriterFactory.Files.Count);
            Assert.AreEqual("<script type=\"text/javascript\" src=\"/some/dynamic/js\"></script>\n", TestUtilities.NormalizeLineEndings(tag));
        }