public void name_is_consistent() { var combination1 = new ScriptFileCombination(_files); var combination2 = new ScriptFileCombination(_files); combination1.Name.ShouldEqual(combination2.Name); }
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(); }
public void append_the_ultimate_extension_to_the_name() { // extension = ".js" var combination1 = new ScriptFileCombination(_files); combination1.Name.ShouldEndWith(".js"); }
public void mime_type_has_to_be_javascript() { var combination = new ScriptFileCombination(new AssetFile[0]); combination.MimeType.ShouldEqual(MimeType.Javascript); }
public void asset_folder_has_to_be_scripts() { var combination = new ScriptFileCombination(new AssetFile[0]); combination.Folder.ShouldEqual(AssetFolder.scripts); }