Пример #1
0
        /// <summary>
        /// Gets a versioned url for bundle or returns the virtual path unchanged if it does not point to a bundle
        /// </summary>
        /// <param name="virtualPath">Virtual file path</param>
        /// <returns>Versioned url for bundle</returns>
        public string GetBundleUrl(string virtualPath)
        {
            if (ValidateVirtualPath(virtualPath, "virtualPath") != null)
            {
                return(null);
            }

            return(_bundles.ResolveBundleUrl(virtualPath));
        }
Пример #2
0
        public void UseCdnWhenSpecifiedTest()
        {
            BundleCollection col = new BundleCollection();

            col.UseCdn = true;
            Bundle b       = new Bundle("~/bundles/a");
            string cdnPath = "cdnPath";

            b.CdnPath = cdnPath;
            col.Add(b);
            Assert.AreEqual(cdnPath, col.ResolveBundleUrl(b.Path));
        }