public void DuplicateScriptAssetsRemovedIsCorrect()
        {
            // Arrange
            var virtualFileSystemWrapper = (new Mock<IVirtualFileSystemWrapper>()).Object;

            var jqueryMinAsset = new Asset(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH,
                "jquery-1.6.2.min.js"), virtualFileSystemWrapper);
            var jqueryAsset = new Asset(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH,
                "jquery-1.6.2.js"), virtualFileSystemWrapper);
            var ajaxLoginAsset = new Asset(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH,
                "AjaxLogin.js"), virtualFileSystemWrapper);
            var microsoftAjaxDebugAsset = new Asset(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH,
                "MicrosoftAjax.debug.js"), virtualFileSystemWrapper);
            var microsoftAjaxAsset = new Asset(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH,
                "MicrosoftAjax.js"), virtualFileSystemWrapper);
            var modernizrAsset = new Asset(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH,
                "modernizr-2.0.6-development-only.js"), virtualFileSystemWrapper);
            var ajaxLoginDuplicateAsset = new Asset(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH,
                "ajaxlogin.js"), virtualFileSystemWrapper);
            var testCoffeeAsset = new Asset(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH,
                "coffee/TestCoffeeScript.coffee"), virtualFileSystemWrapper);
            var testTsAsset = new Asset(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH,
                "ts/TestTypeScript.ts"), virtualFileSystemWrapper);
            var duplicateTestCoffeeAsset = new Asset(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH,
                "coffee/TestCoffeescript.coffee"), virtualFileSystemWrapper);

            IList<IAsset> assets = new List<IAsset>
            {
                jqueryMinAsset,
                jqueryAsset,
                ajaxLoginAsset,
                microsoftAjaxDebugAsset,
                microsoftAjaxAsset,
                modernizrAsset,
                ajaxLoginDuplicateAsset,
                testCoffeeAsset,
                testTsAsset,
                duplicateTestCoffeeAsset
            };

            var scriptDuplicateFilter = new ScriptDuplicateAssetsFilter();

            // Act
            IList<IAsset> processedAssets = scriptDuplicateFilter.Transform(assets);

            // Assert
            Assert.AreEqual(6, processedAssets.Count);
            Assert.AreEqual(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH,
                "jquery-1.6.2.min.js"), processedAssets[0].VirtualPath);
            Assert.AreEqual(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH,
                "AjaxLogin.js"), processedAssets[1].VirtualPath);
            Assert.AreEqual(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH,
                "MicrosoftAjax.debug.js"), processedAssets[2].VirtualPath);
            Assert.AreEqual(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH,
                "modernizr-2.0.6-development-only.js"), processedAssets[3].VirtualPath);
            Assert.AreEqual(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH,
                "coffee/TestCoffeeScript.coffee"), processedAssets[4].VirtualPath);
            Assert.AreEqual(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH,
                "ts/TestTypeScript.ts"), processedAssets[5].VirtualPath);
        }
        public void DuplicateStyleAssetsRemovedIsCorrect()
        {
            // Arrange
            var siteAsset = new Asset(UrlHelpers.Combine(STYLES_DIRECTORY_VIRTUAL_PATH,
                "Site.css"), _virtualFileSystemWrapper);
            var jqueryUiAccordionMinAsset = new Asset(UrlHelpers.Combine(STYLES_DIRECTORY_VIRTUAL_PATH,
                "themes/base/jquery.ui.accordion.min.css"), _virtualFileSystemWrapper);
            var testCssComponentsPathsAsset = new Asset(UrlHelpers.Combine(ALTERNATIVE_STYLES_DIRECTORY_VIRTUAL_PATH,
                "css/TestCssComponentsPaths.css"), _virtualFileSystemWrapper);
            var testCssComponentsPathsMinAsset = new Asset(UrlHelpers.Combine(
                ALTERNATIVE_STYLES_DIRECTORY_VIRTUAL_PATH,
                "css/TestCssComponentsPaths.min.css"), _virtualFileSystemWrapper);
            var siteDuplicateAsset = new Asset(UrlHelpers.Combine(STYLES_DIRECTORY_VIRTUAL_PATH,
                "site.css"), _virtualFileSystemWrapper);
            var testLessAsset = new Asset(UrlHelpers.Combine(STYLES_DIRECTORY_VIRTUAL_PATH,
                "less/TestLess.less"), _virtualFileSystemWrapper);
            var testSassAsset = new Asset(UrlHelpers.Combine(STYLES_DIRECTORY_VIRTUAL_PATH,
                "sass/TestSass.sass"), _virtualFileSystemWrapper);
            var testScssAsset = new Asset(UrlHelpers.Combine(STYLES_DIRECTORY_VIRTUAL_PATH,
                "scss/TestScss.scss"), _virtualFileSystemWrapper);
            var duplicateTestLessAsset = new Asset(UrlHelpers.Combine(STYLES_DIRECTORY_VIRTUAL_PATH,
                "LESS/TestLess.less"), _virtualFileSystemWrapper);

            IList<IAsset> assets = new List<IAsset>
            {
                siteAsset,
                jqueryUiAccordionMinAsset,
                testCssComponentsPathsAsset,
                testCssComponentsPathsMinAsset,
                siteDuplicateAsset,
                testLessAsset,
                testSassAsset,
                testScssAsset,
                duplicateTestLessAsset
            };

            var styleDuplicateFilter = new StyleDuplicateAssetsFilter();

            // Act
            IList<IAsset> processedAssets = styleDuplicateFilter.Transform(assets);

            // Assert
            Assert.AreEqual(6, processedAssets.Count);
            Assert.AreEqual(UrlHelpers.Combine(STYLES_DIRECTORY_VIRTUAL_PATH,
                "Site.css"), processedAssets[0].VirtualPath);
            Assert.AreEqual(UrlHelpers.Combine(STYLES_DIRECTORY_VIRTUAL_PATH,
                "themes/base/jquery.ui.accordion.min.css"), processedAssets[1].VirtualPath);
            Assert.AreEqual(UrlHelpers.Combine(ALTERNATIVE_STYLES_DIRECTORY_VIRTUAL_PATH,
                "css/TestCssComponentsPaths.css"), processedAssets[2].VirtualPath);
            Assert.AreEqual(UrlHelpers.Combine(STYLES_DIRECTORY_VIRTUAL_PATH,
                "less/TestLess.less"), processedAssets[3].VirtualPath);
            Assert.AreEqual(UrlHelpers.Combine(STYLES_DIRECTORY_VIRTUAL_PATH,
                "sass/TestSass.sass"), processedAssets[4].VirtualPath);
            Assert.AreEqual(UrlHelpers.Combine(STYLES_DIRECTORY_VIRTUAL_PATH,
                "scss/TestScss.scss"), processedAssets[5].VirtualPath);
        }
        public void UnneededScriptAssetsRemovedIsCorrect()
        {
            // Arrange
            var virtualFileSystemWrapper = (new Mock<IVirtualFileSystemWrapper>()).Object;

            var ajaxLoginAsset = new Asset(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH,
                "AjaxLogin.js"), virtualFileSystemWrapper);
            var jqueryMinAsset = new Asset(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH,
                "jquery-1.6.2.min.js"), virtualFileSystemWrapper);
            var jqueryVsDocAsset = new Asset(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH,
                "jquery-1.6.2-vsdoc.js"), virtualFileSystemWrapper);
            var jqueryValidateVsDocMinAsset = new Asset(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH,
                "jquery.validate-vsdoc.min.js"), virtualFileSystemWrapper);
            var microsoftAjaxDebugAsset = new Asset(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH,
                "MicrosoftAjax.debug.js"), virtualFileSystemWrapper);
            var telerikAllMinAsset = new Asset(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH,
                "telerik.all.min.js"), virtualFileSystemWrapper);
            var knockoutAsset = new Asset(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH,
                "knockout-2.0.0.js"), virtualFileSystemWrapper);
            var modernizrAsset = new Asset(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH,
                "modernizr-2.0.6-development-only.js"), virtualFileSystemWrapper);
            var referencesAsset = new Asset(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH,
                "_references.js"), virtualFileSystemWrapper);

            var assets = new List<IAsset>
            {
                ajaxLoginAsset,
                jqueryMinAsset,
                jqueryVsDocAsset,
                jqueryValidateVsDocMinAsset,
                microsoftAjaxDebugAsset,
                telerikAllMinAsset,
                knockoutAsset,
                modernizrAsset,
                referencesAsset
            };

            var scriptUnnecessaryAssetsFilter = new ScriptUnnecessaryAssetsFilter(
                new[] { "*-vsdoc.js", "*.all.js", "_references.js" });

            // Act
            IList<IAsset> processedAssets = scriptUnnecessaryAssetsFilter.Transform(assets).ToList();

            // Assert
            Assert.AreEqual(5, processedAssets.Count);
            Assert.AreEqual(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH, "AjaxLogin.js"),
                processedAssets[0].VirtualPath);
            Assert.AreEqual(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH, "jquery-1.6.2.min.js"),
                processedAssets[1].VirtualPath);
            Assert.AreEqual(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH, "MicrosoftAjax.debug.js"),
                processedAssets[2].VirtualPath);
            Assert.AreEqual(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH, "knockout-2.0.0.js"),
                processedAssets[3].VirtualPath);
            Assert.AreEqual(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH,
                "modernizr-2.0.6-development-only.js"), processedAssets[4].VirtualPath);
        }
        public void SaveTranslation(string path)
        {
            IAsset file = new Asset(path);
            CoffeeScriptTranslator translator = new CoffeeScriptTranslator();
            var compiled = translator.Translate(file);

            var normalScript = path.Replace("." + FileExtension, ".js");

            using (var compiledScript = File.CreateText(HostingEnvironment.MapPath(normalScript)))
            {
                compiledScript.Write(compiled.Content);
                compiledScript.Close();
            }
        }
        public void SaveTranslation(string path)
        {
            IAsset file = new Asset(path);
            SassAndScssTranslator translator = new SassAndScssTranslator();
            var compiled = translator.Translate(file);

            var normalCSS = path.Replace("." + FileExtension, ".css");

            using (var compiledCSS = File.CreateText(HostingEnvironment.MapPath(normalCSS)))
            {
                compiledCSS.Write(compiled.Content);
                compiledCSS.Close();
            }
        }
        public IEnumerable<Exception> ValidateTranslation(string path)
        {
            var retVal = new List<Exception>();
            try
            {
                IAsset file = new Asset(path);
                CoffeeScriptTranslator translator = new CoffeeScriptTranslator();
                translator.Translate(file);
            }
            catch (AssetTranslationException ex)
            {
                retVal.Add(ex);
            }

            return retVal;
        }
        public void UnneededStyleAssetsRemovedIsCorrect()
        {
            // Arrange
            var virtualFileSystemWrapper = (new Mock<IVirtualFileSystemWrapper>()).Object;

            var siteAsset = new Asset(UrlHelpers.Combine(STYLES_DIRECTORY_VIRTUAL_PATH, @"Site.css"),
                virtualFileSystemWrapper);
            var jqueryUiAccordionAsset = new Asset(UrlHelpers.Combine(STYLES_DIRECTORY_VIRTUAL_PATH,
                @"themes\base\jquery.ui.accordion.css"), virtualFileSystemWrapper);
            var jqueryUiAllAsset = new Asset(UrlHelpers.Combine(STYLES_DIRECTORY_VIRTUAL_PATH,
                @"themes\base\jquery.ui.all.css"), virtualFileSystemWrapper);
            var testCssComponentsPathsAsset = new Asset(UrlHelpers.Combine(ALTERNATIVE_STYLES_DIRECTORY_VIRTUAL_PATH,
                @"css\TestCssComponentsPaths.css"), virtualFileSystemWrapper);
            var jqueryUiBaseMinAsset = new Asset(UrlHelpers.Combine(STYLES_DIRECTORY_VIRTUAL_PATH,
                @"themes\base\jquery.ui.base.min.css"), virtualFileSystemWrapper);

            var assets = new List<IAsset>
            {
                siteAsset,
                jqueryUiAccordionAsset,
                jqueryUiAllAsset,
                testCssComponentsPathsAsset,
                jqueryUiBaseMinAsset
            };

            var styleUnnecessaryAssetsFilter = new StyleUnnecessaryAssetsFilter(
                new[] { "*.all.css", "jquery.ui.base.css" });

            // Act
            IList<IAsset> processedAssets = styleUnnecessaryAssetsFilter.Transform(assets).ToList();

            // Assert
            Assert.AreEqual(3, processedAssets.Count);
            Assert.AreEqual(UrlHelpers.Combine(STYLES_DIRECTORY_VIRTUAL_PATH, @"Site.css"),
                processedAssets[0].VirtualPath);
            Assert.AreEqual(UrlHelpers.Combine(STYLES_DIRECTORY_VIRTUAL_PATH,
                @"themes\base\jquery.ui.accordion.css"), processedAssets[1].VirtualPath);
            Assert.AreEqual(UrlHelpers.Combine(ALTERNATIVE_STYLES_DIRECTORY_VIRTUAL_PATH,
                @"css\TestCssComponentsPaths.css"), processedAssets[2].VirtualPath);
        }
        private IList<IAsset> GetTestAssets()
        {
            var siteAsset = new Asset(UrlHelpers.Combine(STYLES_DIRECTORY_VIRTUAL_PATH, "Site.css"),
                _virtualFileSystemWrapper);
            var jqueryUiAccordionAsset = new Asset(UrlHelpers.Combine(STYLES_DIRECTORY_VIRTUAL_PATH,
                @"themes\base\jquery.ui.accordion.min.css"), _virtualFileSystemWrapper);
            var testCssComponentsPathsAsset = new Asset(UrlHelpers.Combine(ALTERNATIVE_STYLES_DIRECTORY_VIRTUAL_PATH,
                @"css\TestCssComponentsPaths.css"), _virtualFileSystemWrapper);

            var testAssets = new List<IAsset>
            {
                siteAsset,
                jqueryUiAccordionAsset,
                testCssComponentsPathsAsset
            };

            return testAssets;
        }
        public void StyleAssetsListContainAssetsWithInvalidTypes()
        {
            // Arrange
            var siteCssAsset = new Asset(UrlHelpers.Combine(STYLES_DIRECTORY_VIRTUAL_PATH, "Site.css"),
                _virtualFileSystemWrapper);

            var jqueryJsAsset = new Asset(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH, "jquery-1.6.2.js"),
                _virtualFileSystemWrapper);

            var testLessAsset = new Asset(UrlHelpers.Combine(STYLES_DIRECTORY_VIRTUAL_PATH, "TestLess.less"),
                _virtualFileSystemWrapper);

            var testCoffeeAsset = new Asset(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH, "TestCoffeeScript.coffee"),
                _virtualFileSystemWrapper);

            var testLitCoffeeAsset = new Asset(
                UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH, "TestLiterateCoffeeScript.litcoffee"),
                _virtualFileSystemWrapper);

            var testCoffeeMdAsset = new Asset(
                UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH, "TestCoffeeScriptMarkdown.coffee.md"),
                _virtualFileSystemWrapper);

            var testPlainTextAsset = new Asset(UrlHelpers.Combine(APPLICATION_ROOT_VIRTUAL_PATH, "TestPlainText.txt"),
                _virtualFileSystemWrapper);

            var assets = new List<IAsset>
            {
                siteCssAsset,
                jqueryJsAsset,
                testLessAsset,
                testCoffeeAsset,
                testLitCoffeeAsset,
                testCoffeeMdAsset,
                testPlainTextAsset
            };

            Exception currentException = null;
            var styleAssetTypesValidator = new StyleAssetTypesValidator();

            // Act
            try
            {
                styleAssetTypesValidator.Validate(assets);
            }
            catch(Exception ex)
            {
                currentException = ex;
            }

            var invalidAssetsVirtualPaths = new string[0];
            var invalidAssetTypesException = (InvalidAssetTypesException)currentException;
            if (invalidAssetTypesException != null)
            {
                invalidAssetsVirtualPaths = invalidAssetTypesException.InvalidAssetsVirtualPaths;
            }

            // Assert
            Assert.IsInstanceOf<InvalidAssetTypesException>(currentException);
            Assert.AreEqual(5, invalidAssetsVirtualPaths.Length);
            Assert.Contains(jqueryJsAsset.VirtualPath, invalidAssetsVirtualPaths);
            Assert.Contains(testCoffeeAsset.VirtualPath, invalidAssetsVirtualPaths);
            Assert.Contains(testLitCoffeeAsset.VirtualPath, invalidAssetsVirtualPaths);
            Assert.Contains(testCoffeeMdAsset.VirtualPath, invalidAssetsVirtualPaths);
            Assert.Contains(testPlainTextAsset.VirtualPath, invalidAssetsVirtualPaths);
        }
        public void StyleAssetsListNotContainAssetsWithInvalidTypes()
        {
            // Arrange
            var siteCssAsset = new Asset(UrlHelpers.Combine(STYLES_DIRECTORY_VIRTUAL_PATH, "Site.css"),
                _virtualFileSystemWrapper);

            var testLessAsset = new Asset(UrlHelpers.Combine(STYLES_DIRECTORY_VIRTUAL_PATH, "TestLess.less"),
                _virtualFileSystemWrapper);

            var assets = new List<IAsset>
            {
                siteCssAsset,
                testLessAsset
            };

            Exception currentException = null;

            var styleAssetTypesValidator = new StyleAssetTypesValidator();

            // Act
            try
            {
                styleAssetTypesValidator.Validate(assets);
            }
            catch (Exception ex)
            {
                currentException = ex;
            }

            // Assert
            Assert.IsNotInstanceOf<InvalidAssetTypesException>(currentException);
        }
        private IList<IAsset> GetTestAssets()
        {
            var jqueryAsset = new Asset(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH,
                "jquery-1.6.2.js"), _virtualFileSystemWrapper);
            var jqueryUiAsset = new Asset(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH,
                "jquery-ui-1.8.11.min.js"), _virtualFileSystemWrapper);
            var microsoftAjaxAsset = new Asset(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH,
                "MicrosoftAjax.debug.js"), _virtualFileSystemWrapper);
            var knockoutAsset = new Asset(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH,
                "knockout-2.1.0beta.js"), _virtualFileSystemWrapper);
            var modernizrAsset = new Asset(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH,
                "modernizr-2.0.6-development-only.js"), _virtualFileSystemWrapper);

            var testAssets = new List<IAsset>
            {
                jqueryAsset,
                jqueryUiAsset,
                microsoftAjaxAsset,
                knockoutAsset,
                modernizrAsset
            };

            return testAssets;
        }
        public void ScriptAssetsListNotContainAssetsWithInvalidTypes()
        {
            // Arrange
            var jqueryJsAsset = new Asset(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH, "jquery-1.6.2.js"),
                _virtualFileSystemWrapper);

            var testCoffeeAsset = new Asset(
                UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH, "TestCoffeeScript.coffee"),
                _virtualFileSystemWrapper);

            var assets = new List<IAsset>
            {
                jqueryJsAsset,
                testCoffeeAsset
            };

            Exception currentException = null;
            var scriptAssetTypesValidator = new ScriptAssetTypesValidator();

            // Act
            try
            {
                scriptAssetTypesValidator.Validate(assets);
            }
            catch (Exception ex)
            {
                currentException = ex;
            }

            // Assert
            Assert.IsNotInstanceOf<InvalidAssetTypesException>(currentException);
        }
        public void DeterminationOfAssetTypeIsCorrect()
        {
            // Arrange

            // Act
            var siteCssAsset = new Asset(UrlHelpers.Combine(STYLES_DIRECTORY_VIRTUAL_PATH, "Site.css"),
                _virtualFileSystemWrapper);

            var jqueryJsAsset = new Asset(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH, "jquery-1.6.2.js"),
                _virtualFileSystemWrapper);

            var testLessAsset = new Asset(UrlHelpers.Combine(STYLES_DIRECTORY_VIRTUAL_PATH, "TestLess.less"),
                _virtualFileSystemWrapper);

            var testSassAsset = new Asset(UrlHelpers.Combine(STYLES_DIRECTORY_VIRTUAL_PATH, "TestSass.sass"),
                _virtualFileSystemWrapper);

            var testScssAsset = new Asset(UrlHelpers.Combine(STYLES_DIRECTORY_VIRTUAL_PATH, "TestScss.scss"),
                _virtualFileSystemWrapper);

            var testCoffeeAsset = new Asset(
                UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH, "TestCoffeeScript.coffee"),
                _virtualFileSystemWrapper);

            var testLitCoffeeAsset = new Asset(
                UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH, "TestLiterateCoffeeScript.litcoffee"),
                _virtualFileSystemWrapper);

            var testCoffeeMdAsset = new Asset(
                UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH, "TestCoffeeScriptMarkdown.coffee.md"),
                _virtualFileSystemWrapper);

            var testTsAsset = new Asset(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH, "TestTypeScript.ts"),
                _virtualFileSystemWrapper);

            var testHandlebarsAsset = new Asset(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH, "TestHandlebars.handlebars"),
                _virtualFileSystemWrapper);

            var testShortHandlebarsAsset = new Asset(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH, "TestShortHandlebars.hbs"),
                _virtualFileSystemWrapper);

            var testPlainTextAsset = new Asset(UrlHelpers.Combine(APPLICATION_ROOT_VIRTUAL_PATH, "TestPlainText.txt"),
                _virtualFileSystemWrapper);

            // Assert
            Assert.AreEqual(CoreAssetTypeCodes.Css, siteCssAsset.AssetTypeCode);
            Assert.AreEqual(CoreAssetTypeCodes.JavaScript, jqueryJsAsset.AssetTypeCode);
            Assert.AreEqual(LessAssetTypeCodes.Less, testLessAsset.AssetTypeCode);
            Assert.AreEqual(SassAndScssAssetTypeCodes.Sass, testSassAsset.AssetTypeCode);
            Assert.AreEqual(SassAndScssAssetTypeCodes.Scss, testScssAsset.AssetTypeCode);
            Assert.AreEqual(CoffeeScriptAssetTypeCodes.CoffeeScript, testCoffeeAsset.AssetTypeCode);
            Assert.AreEqual(CoffeeScriptAssetTypeCodes.LiterateCoffeeScript, testLitCoffeeAsset.AssetTypeCode);
            Assert.AreEqual(CoffeeScriptAssetTypeCodes.LiterateCoffeeScript, testCoffeeMdAsset.AssetTypeCode);
            Assert.AreEqual(TypeScriptAssetTypeCodes.TypeScript, testTsAsset.AssetTypeCode);
            Assert.AreEqual(HandlebarsAssetTypeCodes.Handlebars, testHandlebarsAsset.AssetTypeCode);
            Assert.AreEqual(HandlebarsAssetTypeCodes.Handlebars, testShortHandlebarsAsset.AssetTypeCode);
            Assert.AreEqual(CoreAssetTypeCodes.Unknown, testPlainTextAsset.AssetTypeCode);

            Assert.AreEqual(siteCssAsset.IsStylesheet, true);
            Assert.AreEqual(siteCssAsset.IsScript, false);
            Assert.AreEqual(jqueryJsAsset.IsStylesheet, false);
            Assert.AreEqual(jqueryJsAsset.IsScript, true);
            Assert.AreEqual(testLessAsset.IsStylesheet, true);
            Assert.AreEqual(testLessAsset.IsScript, false);
            Assert.AreEqual(testSassAsset.IsStylesheet, true);
            Assert.AreEqual(testSassAsset.IsScript, false);
            Assert.AreEqual(testScssAsset.IsStylesheet, true);
            Assert.AreEqual(testScssAsset.IsScript, false);
            Assert.AreEqual(testCoffeeAsset.IsStylesheet, false);
            Assert.AreEqual(testCoffeeAsset.IsScript, true);
            Assert.AreEqual(testLitCoffeeAsset.IsStylesheet, false);
            Assert.AreEqual(testLitCoffeeAsset.IsScript, true);
            Assert.AreEqual(testCoffeeMdAsset.IsStylesheet, false);
            Assert.AreEqual(testCoffeeMdAsset.IsScript, true);
            Assert.AreEqual(testTsAsset.IsStylesheet, false);
            Assert.AreEqual(testTsAsset.IsScript, true);
            Assert.AreEqual(testHandlebarsAsset.IsStylesheet, false);
            Assert.AreEqual(testHandlebarsAsset.IsScript, true);
            Assert.AreEqual(testShortHandlebarsAsset.IsStylesheet, false);
            Assert.AreEqual(testShortHandlebarsAsset.IsScript, true);
            Assert.AreEqual(testPlainTextAsset.IsStylesheet, false);
            Assert.AreEqual(testPlainTextAsset.IsScript, false);
        }
        public void UrlCalculationIsCorrect()
        {
            // Arrange
            var siteCssAsset = new Asset(UrlHelpers.Combine(STYLES_DIRECTORY_VIRTUAL_PATH, "Site.css"),
                _virtualFileSystemWrapper);
            var jqueryAsset = new Asset(UrlHelpers.Combine(SCRIPTS_DIRECTORY_VIRTUAL_PATH, "jquery-1.6.2.js"),
                _virtualFileSystemWrapper);

            // Act
            string siteCssAssetUrl = siteCssAsset.Url;
            string jqueryAssetUrl = jqueryAsset.Url;

            // Assert
            Assert.AreEqual(UrlHelpers.Combine(STYLES_DIRECTORY_URL, "Site.css"), siteCssAssetUrl);
            Assert.AreEqual(UrlHelpers.Combine(SCRIPTS_DIRECTORY_URL, "jquery-1.6.2.js"), jqueryAssetUrl);
        }