void AddHtmlAttribute(BundleManifest manifest, XElement attributeElement) { var name = GetHtmlAttributeElementNameAttribute(attributeElement); var value = attributeElement.AttributeValueOrNull("Value"); manifest.HtmlAttributes.Add(name, value); }
void AddHtmlAttributes(BundleManifest manifest) { var attributeElements = element.Elements("HtmlAttribute"); foreach (var attributeElement in attributeElements) { AddHtmlAttribute(manifest, attributeElement); } }
void AddReferences(BundleManifest manifest) { var paths = GetReferencePaths(); foreach (var path in paths) { manifest.References.Add(path); } }
public ScriptBundleManifestBuilder_Tests() { bundle = new ScriptBundle("~/path") { PageLocation = "body", Hash = new byte[] { 1, 2, 3 } }; asset = StubAsset(); bundle.Assets.Add(asset); bundle.AddReference("~/reference/path"); bundle.Process(new CassetteSettings("")); manifest = builder.BuildManifest(bundle); }
void AddAssets(BundleManifest manifest) { var assetElements = element.Elements("Asset"); var assetManifests = assetElements.Select(e => new AssetManifestReader(e).Read()); foreach (var assetManifest in assetManifests) { manifest.Assets.Add(assetManifest); } }
public ScriptBundleManifestBuilder_Tests() { bundle = new ScriptBundle("~/path") { PageLocation = "body", Hash = new byte[] { 1, 2, 3 }, Processor = new ScriptPipeline() }; asset = new StubAsset { CreateStream = () => new MemoryStream(bundleContent), References = { new AssetReference("~/path/asset/file", asset, 0, AssetReferenceType.RawFilename) } }; bundle.Assets.Add(asset); bundle.AddReference("~/reference/path"); bundle.Process(new CassetteSettings("")); var urlModifier = Mock.Of<IUrlModifier>(); bundle.Renderer = new ConstantHtmlRenderer<ScriptBundle>("", urlModifier); manifest = builder.BuildManifest(bundle); }
public void GivenIncludeContentIsFalse_ThenManifestContentIsNull() { builder.IncludeContent = false; manifest = builder.BuildManifest(bundle); manifest.Content.ShouldBeNull(); }
public void GivenBundleWithNoAssetsThenManifestContentIsNull() { bundle.Assets.Clear(); manifest = builder.BuildManifest(bundle); manifest.Content.ShouldBeNull(); }
public void GivenBundleWithHtmlAttributes_ThenManifestHasHtmlAttributes() { bundle.HtmlAttributes.Add("attribute", "value"); manifest = builder.BuildManifest(bundle); manifest.HtmlAttributes["attribute"].ShouldEqual("value"); }
Action <BundleManifest> GetWriteActionForBundleManifest(BundleManifest bundleManifest) { return(writeActions[bundleManifest.GetType()]); }
void WriteBundleManifest(BundleManifest bundleManifest) { var write = GetWriteActionForBundleManifest(bundleManifest); write(bundleManifest); }
void ReadBundleManifest() { var reader = new ScriptBundleManifestReader(element); readManifest = reader.Read(); }