コード例 #1
0
        public void name_is_consistent()
        {
            var combination1 = new ScriptFileCombination(_files);
            var combination2 = new ScriptFileCombination(_files);

            combination1.Name.ShouldEqual(combination2.Name);
        }
コード例 #2
0
        public void find_combination_in_the_underlying_storage()
        {
            var theCache = new AssetCombinationCache();
            var scriptCombo1 = new ScriptFileCombination("script1", files(5));
            theCache.StoreCombination(MimeType.Javascript, scriptCombo1);
            theCache.StoreCombination(MimeType.Javascript, new ScriptFileCombination("script2", files(6)));
            theCache.StoreCombination(MimeType.Javascript, new ScriptFileCombination("script3", files(7)));
            theCache.StoreCombination(MimeType.Javascript, new ScriptFileCombination("script4", files(4)));

            theCache.StoreCombination(MimeType.Css, new StyleFileCombination("css1", null, files(10)));
            theCache.StoreCombination(MimeType.Css, new StyleFileCombination("css2", null, files(8)));
            var cssCombo3 = new StyleFileCombination("css3", null, files(12));
            theCache.StoreCombination(MimeType.Css, cssCombo3);
            theCache.StoreCombination(MimeType.Css, new StyleFileCombination("css4", null, files(15)));

            theCache.FindCombination("script1").ShouldBeTheSameAs(scriptCombo1);
            theCache.FindCombination("css3").ShouldBeTheSameAs(cssCombo3);

            theCache.FindCombination("something that does not exist").ShouldBeNull();
        }
コード例 #3
0
 public void append_the_ultimate_extension_to_the_name()
 {
     // extension = ".js"
     var combination1 = new ScriptFileCombination(_files);
     combination1.Name.ShouldEndWith(".js");
 }
コード例 #4
0
 public void mime_type_has_to_be_javascript()
 {
     var combination = new ScriptFileCombination(new AssetFile[0]);
     combination.MimeType.ShouldEqual(MimeType.Javascript);
 }
コード例 #5
0
 public void asset_folder_has_to_be_scripts()
 {
     var combination = new ScriptFileCombination(new AssetFile[0]);
     combination.Folder.ShouldEqual(AssetFolder.scripts);
 }