From afbc6889c73d58136cb8851858ca3c17f41dc2c5 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Thu, 26 Mar 2020 15:21:06 +1000 Subject: Add BundleExtension element. Add GetTestXml. Fix issue with building with current version of burn. --- .../ExtractBAContainerResult.cs | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/WixToolset.Core.TestPackage/ExtractBAContainerResult.cs (limited to 'src/WixToolset.Core.TestPackage/ExtractBAContainerResult.cs') diff --git a/src/WixToolset.Core.TestPackage/ExtractBAContainerResult.cs b/src/WixToolset.Core.TestPackage/ExtractBAContainerResult.cs new file mode 100644 index 00000000..6d2ea943 --- /dev/null +++ b/src/WixToolset.Core.TestPackage/ExtractBAContainerResult.cs @@ -0,0 +1,39 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Core.TestPackage +{ + using System.IO; + using System.Xml; + using Xunit; + + public class ExtractBAContainerResult + { + public XmlDocument ManifestDocument { get; set; } + public XmlNamespaceManager ManifestNamespaceManager { get; set; } + public bool Success { get; set; } + + public ExtractBAContainerResult AssertSuccess() + { + Assert.True(this.Success); + return this; + } + + public string GetBAFilePath(string extractedBAContainerFolderPath) + { + var uxPayloads = this.SelectManifestNodes("/burn:BurnManifest/burn:UX/burn:Payload"); + var baPayload = uxPayloads[0]; + var relativeBAPath = baPayload.Attributes["FilePath"].Value; + return Path.Combine(extractedBAContainerFolderPath, relativeBAPath); + } + + /// + /// + /// + /// elements must have the 'burn' prefix + /// + public XmlNodeList SelectManifestNodes(string xpath) + { + return this.ManifestDocument.SelectNodes(xpath, this.ManifestNamespaceManager); + } + } +} -- cgit v1.2.3-55-g6feb