public void CodeDomDefinedExtensionDoesNotThrowTest()
        {
            var virtualPath = "Layout.txt";

            // Should not throw an exception
            BuildManagerExceptionUtil.ThrowIfCodeDomDefinedExtension(virtualPath, new HttpCompileException());
        }
        public void CodeDomDefinedExtensionThrowsTest()
        {
            var extension   = ".js";
            var virtualPath = "Layout.js";

            Assert.Throws <HttpException>(
                () => { BuildManagerExceptionUtil.ThrowIfCodeDomDefinedExtension(virtualPath, new HttpCompileException()); }, String.Format(CultureInfo.CurrentCulture, WebPageResources.WebPage_FileNotSupported, extension, virtualPath));
        }
        public void IsUnsupportedExtensionThrowsTest()
        {
            var extension   = ".txt";
            var virtualPath = "Layout.txt";
            var e           = CompilationUtil.GetBuildProviderException(extension);

            Assert.Throws <HttpException>(
                () => { BuildManagerExceptionUtil.ThrowIfUnsupportedExtension(virtualPath, e); }, String.Format(CultureInfo.CurrentCulture, WebPageResources.WebPage_FileNotSupported, extension, virtualPath));
        }
        public void IsUnsupportedExtensionError()
        {
            Assert.False(BuildManagerExceptionUtil.IsUnsupportedExtensionError(new HttpException("The following file could not be rendered because its extension \".txt\" might not be supported: \"myfile.txt\".")));

            var e = CompilationUtil.GetBuildProviderException(".txt");

            Assert.NotNull(e);
            Assert.True(BuildManagerExceptionUtil.IsUnsupportedExtensionError(e));
        }