public BundlesHelper_Tests() { settings = new CassetteSettings(); bundles = new BundleCollection(settings, Mock.Of<IFileSearchProvider>(), Mock.Of<IBundleFactoryProvider>(), Mock.Of<IBundleCollectionInitializer>()); referenceBuilder = new Mock<IReferenceBuilder>(); var urlModifier = new VirtualDirectoryPrepender("/"); var urlGenerator = new UrlGenerator(urlModifier, new FakeFileSystem(), "cassette.axd/"); helper = new BundlesHelper(bundles, settings, urlGenerator, () => referenceBuilder.Object, Mock.Of<IFileAccessAuthorization>(), Mock.Of<IBundleCacheRebuilder>(), new SimpleJsonSerializer()); }
public BundlesHelper_Tests() { settings = new CassetteSettings(); bundles = new BundleCollection(settings, Mock.Of <IFileSearchProvider>(), Mock.Of <IBundleFactoryProvider>(), Mock.Of <IBundleCollectionInitializer>()); referenceBuilder = new Mock <IReferenceBuilder>(); var urlModifier = new VirtualDirectoryPrepender("/"); var urlGenerator = new UrlGenerator(urlModifier, new FakeFileSystem(), "cassette.axd/"); helper = new BundlesHelper(bundles, settings, urlGenerator, () => referenceBuilder.Object, Mock.Of <IFileAccessAuthorization>(), Mock.Of <IBundleCacheRebuilder>(), new SimpleJsonSerializer()); }
public ExternalScriptBundleDeserializer_Tests() { element = new XElement( "ExternalScriptBundle", new XAttribute("Path", "~"), new XAttribute("Hash", "010203"), new XAttribute("Url", "http://example.com/"), new XAttribute("FallbackCondition", "CONDITION") ); directory = new FakeFileSystem { { "~/script/010203.js", "content" } }; var urlModifier = new VirtualDirectoryPrepender("/"); reader = new ExternalScriptBundleDeserializer(urlModifier); DeserializeToBundle(); }
public StylesheetBundleDeserializer_Tests() { mediaElement = new XElement("HtmlAttribute", new XAttribute("Name", "media"), new XAttribute("Value", "expected-media")); element = new XElement( "StylesheetBundle", new XAttribute("Path", "~"), new XAttribute("Hash", "010203"), new XAttribute("Condition", "expected-condition"), mediaElement ); directory = new FakeFileSystem { { "~/stylesheet/010203.css", "content" } }; var urlModifier = new VirtualDirectoryPrepender("/"); reader = new StylesheetBundleDeserializer(urlModifier); DeserializeBundle(); }
public ExternalStylesheetBundleDeserializer_Tests() { element = new XElement( "ExternalStylesheetBundle", new XAttribute("Path", "~"), new XAttribute("Hash", "010203"), new XAttribute("Url", "http://example.com/"), new XAttribute("Condition", "CONDITION"), new XElement("HtmlAttribute", new XAttribute("Name", "media"), new XAttribute("Value", "MEDIA")) ); directory = new FakeFileSystem { { "~/stylesheet/010203.css", "content" } }; var urlModifier = new VirtualDirectoryPrepender("/"); reader = new ExternalStylesheetBundleDeserializer(urlModifier); DeserializeElement(); }
public ExternalStylesheetBundleDeserializer_Tests() { element = new XElement( "ExternalStylesheetBundle", new XAttribute("Path", "~"), new XAttribute("Hash", "010203"), new XAttribute("Url", "http://example.com/"), new XAttribute("Condition", "CONDITION"), new XElement("HtmlAttribute", new XAttribute("Name", "media"), new XAttribute("Value", "MEDIA")) ); directory = new FakeFileSystem { { "~/stylesheet/010203.css", "content"} }; var urlModifier = new VirtualDirectoryPrepender("/"); reader = new ExternalStylesheetBundleDeserializer(urlModifier); DeserializeElement(); }
public ScriptBundleDeserializer_Tests() { element = new XElement("ScriptBundle", new XAttribute("Path", "~"), new XAttribute("Hash", "010203"), new XAttribute("Condition", "expected-condition"), new XAttribute("ContentType", "text/javascript"), new XAttribute("PageLocation", "PAGE-LOCATION"), new XElement("Asset", new XAttribute("Path", "~/asset-1"), new XAttribute("AssetCacheValidatorType", typeof(FileAssetCacheValidator).FullName)), new XElement("Asset", new XAttribute("Path", "~/asset-2"), new XAttribute("AssetCacheValidatorType", typeof(FileAssetCacheValidator).FullName)), new XElement("Reference", new XAttribute("Path", "~/reference-1")), new XElement("Reference", new XAttribute("Path", "~/reference-2")), new XElement( "HtmlAttribute", new XAttribute("Name", "type"), new XAttribute("Value", "text/javascript") ), new XElement( "HtmlAttribute", new XAttribute("Name", "attribute1"), new XAttribute("Value", "value1") ), new XElement( "HtmlAttribute", new XAttribute("Name", "attribute2"), new XAttribute("Value", "value2") ) ); directory = new FakeFileSystem { { "~/script/010203.js", "CONTENT" } }; var urlModifier = new VirtualDirectoryPrepender("/"); deserializer = new ScriptBundleDeserializer(urlModifier); DeserializeBundle(); }