diff options
Diffstat (limited to 'src/WixToolset.Core.TestPackage')
7 files changed, 166 insertions, 1 deletions
diff --git a/src/WixToolset.Core.TestPackage/BundleExtractor.cs b/src/WixToolset.Core.TestPackage/BundleExtractor.cs index 8a56f117..ad97f113 100644 --- a/src/WixToolset.Core.TestPackage/BundleExtractor.cs +++ b/src/WixToolset.Core.TestPackage/BundleExtractor.cs | |||
| @@ -7,8 +7,19 @@ namespace WixToolset.Core.TestPackage | |||
| 7 | using WixToolset.Core.Burn.Bundles; | 7 | using WixToolset.Core.Burn.Bundles; |
| 8 | using WixToolset.Extensibility.Services; | 8 | using WixToolset.Extensibility.Services; |
| 9 | 9 | ||
| 10 | /// <summary> | ||
| 11 | /// Class to extract bundle contents for testing. | ||
| 12 | /// </summary> | ||
| 10 | public class BundleExtractor | 13 | public class BundleExtractor |
| 11 | { | 14 | { |
| 15 | /// <summary> | ||
| 16 | /// Extracts the BA container. | ||
| 17 | /// </summary> | ||
| 18 | /// <param name="messaging"></param> | ||
| 19 | /// <param name="bundleFilePath">Path to the bundle.</param> | ||
| 20 | /// <param name="destinationFolderPath">Path to extract to.</param> | ||
| 21 | /// <param name="tempFolderPath">Temp path for extraction.</param> | ||
| 22 | /// <returns></returns> | ||
| 12 | public static ExtractBAContainerResult ExtractBAContainer(IMessaging messaging, string bundleFilePath, string destinationFolderPath, string tempFolderPath) | 23 | public static ExtractBAContainerResult ExtractBAContainer(IMessaging messaging, string bundleFilePath, string destinationFolderPath, string tempFolderPath) |
| 13 | { | 24 | { |
| 14 | var result = new ExtractBAContainerResult(); | 25 | var result = new ExtractBAContainerResult(); |
| @@ -33,6 +44,12 @@ namespace WixToolset.Core.TestPackage | |||
| 33 | return result; | 44 | return result; |
| 34 | } | 45 | } |
| 35 | 46 | ||
| 47 | /// <summary> | ||
| 48 | /// Gets an <see cref="XmlNamespaceManager"/> for BootstrapperApplicationData.xml with the given prefix assigned to the root namespace. | ||
| 49 | /// </summary> | ||
| 50 | /// <param name="document"></param> | ||
| 51 | /// <param name="prefix"></param> | ||
| 52 | /// <returns></returns> | ||
| 36 | public static XmlNamespaceManager GetBADataNamespaceManager(XmlDocument document, string prefix) | 53 | public static XmlNamespaceManager GetBADataNamespaceManager(XmlDocument document, string prefix) |
| 37 | { | 54 | { |
| 38 | var namespaceManager = new XmlNamespaceManager(document.NameTable); | 55 | var namespaceManager = new XmlNamespaceManager(document.NameTable); |
| @@ -40,6 +57,12 @@ namespace WixToolset.Core.TestPackage | |||
| 40 | return namespaceManager; | 57 | return namespaceManager; |
| 41 | } | 58 | } |
| 42 | 59 | ||
| 60 | /// <summary> | ||
| 61 | /// Gets an <see cref="XmlNamespaceManager"/> for BundleExtensionData.xml with the given prefix assigned to the root namespace. | ||
| 62 | /// </summary> | ||
| 63 | /// <param name="document"></param> | ||
| 64 | /// <param name="prefix"></param> | ||
| 65 | /// <returns></returns> | ||
| 43 | public static XmlNamespaceManager GetBundleExtensionDataNamespaceManager(XmlDocument document, string prefix) | 66 | public static XmlNamespaceManager GetBundleExtensionDataNamespaceManager(XmlDocument document, string prefix) |
| 44 | { | 67 | { |
| 45 | var namespaceManager = new XmlNamespaceManager(document.NameTable); | 68 | var namespaceManager = new XmlNamespaceManager(document.NameTable); |
| @@ -47,6 +70,12 @@ namespace WixToolset.Core.TestPackage | |||
| 47 | return namespaceManager; | 70 | return namespaceManager; |
| 48 | } | 71 | } |
| 49 | 72 | ||
| 73 | /// <summary> | ||
| 74 | /// Gets an <see cref="XmlNamespaceManager"/> for the Burn manifest.xml with the given prefix assigned to the root namespace. | ||
| 75 | /// </summary> | ||
| 76 | /// <param name="document"></param> | ||
| 77 | /// <param name="prefix"></param> | ||
| 78 | /// <returns></returns> | ||
| 50 | public static XmlNamespaceManager GetBurnNamespaceManager(XmlDocument document, string prefix) | 79 | public static XmlNamespaceManager GetBurnNamespaceManager(XmlDocument document, string prefix) |
| 51 | { | 80 | { |
| 52 | var namespaceManager = new XmlNamespaceManager(document.NameTable); | 81 | var namespaceManager = new XmlNamespaceManager(document.NameTable); |
| @@ -54,6 +83,11 @@ namespace WixToolset.Core.TestPackage | |||
| 54 | return namespaceManager; | 83 | return namespaceManager; |
| 55 | } | 84 | } |
| 56 | 85 | ||
| 86 | /// <summary> | ||
| 87 | /// Loads an XmlDocument with the BootstrapperApplicationData.xml from the given folder that contains the contents of the BA container. | ||
| 88 | /// </summary> | ||
| 89 | /// <param name="baFolderPath"></param> | ||
| 90 | /// <returns></returns> | ||
| 57 | public static XmlDocument LoadBAData(string baFolderPath) | 91 | public static XmlDocument LoadBAData(string baFolderPath) |
| 58 | { | 92 | { |
| 59 | var document = new XmlDocument(); | 93 | var document = new XmlDocument(); |
| @@ -61,6 +95,11 @@ namespace WixToolset.Core.TestPackage | |||
| 61 | return document; | 95 | return document; |
| 62 | } | 96 | } |
| 63 | 97 | ||
| 98 | /// <summary> | ||
| 99 | /// Loads an XmlDocument with the BootstrapperApplicationData.xml from the given folder that contains the contents of the BA container. | ||
| 100 | /// </summary> | ||
| 101 | /// <param name="baFolderPath"></param> | ||
| 102 | /// <returns></returns> | ||
| 64 | public static XmlDocument LoadBundleExtensionData(string baFolderPath) | 103 | public static XmlDocument LoadBundleExtensionData(string baFolderPath) |
| 65 | { | 104 | { |
| 66 | var document = new XmlDocument(); | 105 | var document = new XmlDocument(); |
| @@ -68,6 +107,11 @@ namespace WixToolset.Core.TestPackage | |||
| 68 | return document; | 107 | return document; |
| 69 | } | 108 | } |
| 70 | 109 | ||
| 110 | /// <summary> | ||
| 111 | /// Loads an XmlDocument with the BootstrapperApplicationData.xml from the given folder that contains the contents of the BA container. | ||
| 112 | /// </summary> | ||
| 113 | /// <param name="baFolderPath"></param> | ||
| 114 | /// <returns></returns> | ||
| 71 | public static XmlDocument LoadBurnManifest(string baFolderPath) | 115 | public static XmlDocument LoadBurnManifest(string baFolderPath) |
| 72 | { | 116 | { |
| 73 | var document = new XmlDocument(); | 117 | var document = new XmlDocument(); |
diff --git a/src/WixToolset.Core.TestPackage/ExtractBAContainerResult.cs b/src/WixToolset.Core.TestPackage/ExtractBAContainerResult.cs index 63d7bb31..277861ff 100644 --- a/src/WixToolset.Core.TestPackage/ExtractBAContainerResult.cs +++ b/src/WixToolset.Core.TestPackage/ExtractBAContainerResult.cs | |||
| @@ -6,22 +6,61 @@ namespace WixToolset.Core.TestPackage | |||
| 6 | using System.Xml; | 6 | using System.Xml; |
| 7 | using Xunit; | 7 | using Xunit; |
| 8 | 8 | ||
| 9 | /// <summary> | ||
| 10 | /// The result of extracting the BA container. | ||
| 11 | /// </summary> | ||
| 9 | public class ExtractBAContainerResult | 12 | public class ExtractBAContainerResult |
| 10 | { | 13 | { |
| 14 | /// <summary> | ||
| 15 | /// <see cref="XmlDocument"/> for BundleExtensionData.xml. | ||
| 16 | /// </summary> | ||
| 11 | public XmlDocument BundleExtensionDataDocument { get; set; } | 17 | public XmlDocument BundleExtensionDataDocument { get; set; } |
| 18 | |||
| 19 | /// <summary> | ||
| 20 | /// <see cref="XmlNamespaceManager"/> for BundleExtensionData.xml. | ||
| 21 | /// </summary> | ||
| 12 | public XmlNamespaceManager BundleExtensionDataNamespaceManager { get; set; } | 22 | public XmlNamespaceManager BundleExtensionDataNamespaceManager { get; set; } |
| 23 | |||
| 24 | /// <summary> | ||
| 25 | /// <see cref="XmlDocument"/> for BootstrapperApplicationData.xml. | ||
| 26 | /// </summary> | ||
| 13 | public XmlDocument BADataDocument { get; set; } | 27 | public XmlDocument BADataDocument { get; set; } |
| 28 | |||
| 29 | /// <summary> | ||
| 30 | /// <see cref="XmlNamespaceManager"/> for BootstrapperApplicationData.xml. | ||
| 31 | /// </summary> | ||
| 14 | public XmlNamespaceManager BADataNamespaceManager { get; set; } | 32 | public XmlNamespaceManager BADataNamespaceManager { get; set; } |
| 33 | |||
| 34 | /// <summary> | ||
| 35 | /// <see cref="XmlDocument"/> for the Burn manifest.xml. | ||
| 36 | /// </summary> | ||
| 15 | public XmlDocument ManifestDocument { get; set; } | 37 | public XmlDocument ManifestDocument { get; set; } |
| 38 | |||
| 39 | /// <summary> | ||
| 40 | /// <see cref="XmlNamespaceManager"/> for the Burn manifest.xml. | ||
| 41 | /// </summary> | ||
| 16 | public XmlNamespaceManager ManifestNamespaceManager { get; set; } | 42 | public XmlNamespaceManager ManifestNamespaceManager { get; set; } |
| 43 | |||
| 44 | /// <summary> | ||
| 45 | /// Whether extraction succeeded. | ||
| 46 | /// </summary> | ||
| 17 | public bool Success { get; set; } | 47 | public bool Success { get; set; } |
| 18 | 48 | ||
| 49 | /// <summary> | ||
| 50 | /// | ||
| 51 | /// </summary> | ||
| 52 | /// <returns></returns> | ||
| 19 | public ExtractBAContainerResult AssertSuccess() | 53 | public ExtractBAContainerResult AssertSuccess() |
| 20 | { | 54 | { |
| 21 | Assert.True(this.Success); | 55 | Assert.True(this.Success); |
| 22 | return this; | 56 | return this; |
| 23 | } | 57 | } |
| 24 | 58 | ||
| 59 | /// <summary> | ||
| 60 | /// Returns the relative path of the BA entry point dll in the given folder. | ||
| 61 | /// </summary> | ||
| 62 | /// <param name="extractedBAContainerFolderPath"></param> | ||
| 63 | /// <returns></returns> | ||
| 25 | public string GetBAFilePath(string extractedBAContainerFolderPath) | 64 | public string GetBAFilePath(string extractedBAContainerFolderPath) |
| 26 | { | 65 | { |
| 27 | var uxPayloads = this.SelectManifestNodes("/burn:BurnManifest/burn:UX/burn:Payload"); | 66 | var uxPayloads = this.SelectManifestNodes("/burn:BurnManifest/burn:UX/burn:Payload"); |
| @@ -30,6 +69,12 @@ namespace WixToolset.Core.TestPackage | |||
| 30 | return Path.Combine(extractedBAContainerFolderPath, relativeBAPath); | 69 | return Path.Combine(extractedBAContainerFolderPath, relativeBAPath); |
| 31 | } | 70 | } |
| 32 | 71 | ||
| 72 | /// <summary> | ||
| 73 | /// Returns the relative path of the BundleExtension entry point dll in the given folder. | ||
| 74 | /// </summary> | ||
| 75 | /// <param name="extractedBAContainerFolderPath"></param> | ||
| 76 | /// <param name="extensionId"></param> | ||
| 77 | /// <returns></returns> | ||
| 33 | public string GetBundleExtensionFilePath(string extractedBAContainerFolderPath, string extensionId) | 78 | public string GetBundleExtensionFilePath(string extractedBAContainerFolderPath, string extensionId) |
| 34 | { | 79 | { |
| 35 | var uxPayloads = this.SelectManifestNodes($"/burn:BurnManifest/burn:UX/burn:Payload[@Id='{extensionId}']"); | 80 | var uxPayloads = this.SelectManifestNodes($"/burn:BurnManifest/burn:UX/burn:Payload[@Id='{extensionId}']"); |
diff --git a/src/WixToolset.Core.TestPackage/TestMessageListener.cs b/src/WixToolset.Core.TestPackage/TestMessageListener.cs index b5863869..7040fe82 100644 --- a/src/WixToolset.Core.TestPackage/TestMessageListener.cs +++ b/src/WixToolset.Core.TestPackage/TestMessageListener.cs | |||
| @@ -5,24 +5,51 @@ using WixToolset.Extensibility.Services; | |||
| 5 | 5 | ||
| 6 | namespace WixToolset.Core.TestPackage | 6 | namespace WixToolset.Core.TestPackage |
| 7 | { | 7 | { |
| 8 | /// <summary> | ||
| 9 | /// An <see cref="IMessageListener"/> that simply stores all the messages. | ||
| 10 | /// </summary> | ||
| 8 | public sealed class TestMessageListener : IMessageListener | 11 | public sealed class TestMessageListener : IMessageListener |
| 9 | { | 12 | { |
| 13 | /// <summary> | ||
| 14 | /// All messages that have been received. | ||
| 15 | /// </summary> | ||
| 10 | public List<Message> Messages { get; } = new List<Message>(); | 16 | public List<Message> Messages { get; } = new List<Message>(); |
| 11 | 17 | ||
| 18 | /// <summary> | ||
| 19 | /// | ||
| 20 | /// </summary> | ||
| 12 | public string ShortAppName => "TEST"; | 21 | public string ShortAppName => "TEST"; |
| 13 | 22 | ||
| 23 | /// <summary> | ||
| 24 | /// | ||
| 25 | /// </summary> | ||
| 14 | public string LongAppName => "Test"; | 26 | public string LongAppName => "Test"; |
| 15 | 27 | ||
| 28 | /// <summary> | ||
| 29 | /// Stores the message in <see cref="Messages"/>. | ||
| 30 | /// </summary> | ||
| 31 | /// <param name="message"></param> | ||
| 16 | public void Write(Message message) | 32 | public void Write(Message message) |
| 17 | { | 33 | { |
| 18 | this.Messages.Add(message); | 34 | this.Messages.Add(message); |
| 19 | } | 35 | } |
| 20 | 36 | ||
| 37 | /// <summary> | ||
| 38 | /// Stores the message in <see cref="Messages"/>. | ||
| 39 | /// </summary> | ||
| 40 | /// <param name="message"></param> | ||
| 21 | public void Write(string message) | 41 | public void Write(string message) |
| 22 | { | 42 | { |
| 23 | this.Messages.Add(new Message(null, MessageLevel.Information, 0, message)); | 43 | this.Messages.Add(new Message(null, MessageLevel.Information, 0, message)); |
| 24 | } | 44 | } |
| 25 | 45 | ||
| 46 | /// <summary> | ||
| 47 | /// Always returns defaultMessageLevel. | ||
| 48 | /// </summary> | ||
| 49 | /// <param name="messaging"></param> | ||
| 50 | /// <param name="message"></param> | ||
| 51 | /// <param name="defaultMessageLevel"></param> | ||
| 52 | /// <returns></returns> | ||
| 26 | public MessageLevel CalculateMessageLevel(IMessaging messaging, Message message, MessageLevel defaultMessageLevel) => defaultMessageLevel; | 53 | public MessageLevel CalculateMessageLevel(IMessaging messaging, Message message, MessageLevel defaultMessageLevel) => defaultMessageLevel; |
| 27 | } | 54 | } |
| 28 | } | 55 | } |
diff --git a/src/WixToolset.Core.TestPackage/WixRunner.cs b/src/WixToolset.Core.TestPackage/WixRunner.cs index 940b55a8..a3883cd5 100644 --- a/src/WixToolset.Core.TestPackage/WixRunner.cs +++ b/src/WixToolset.Core.TestPackage/WixRunner.cs | |||
| @@ -9,11 +9,19 @@ namespace WixToolset.Core.TestPackage | |||
| 9 | using WixToolset.Core.Burn; | 9 | using WixToolset.Core.Burn; |
| 10 | using WixToolset.Core.WindowsInstaller; | 10 | using WixToolset.Core.WindowsInstaller; |
| 11 | using WixToolset.Data; | 11 | using WixToolset.Data; |
| 12 | using WixToolset.Extensibility.Data; | ||
| 13 | using WixToolset.Extensibility.Services; | 12 | using WixToolset.Extensibility.Services; |
| 14 | 13 | ||
| 14 | /// <summary> | ||
| 15 | /// Utility class to emulate wix.exe with standard backends. | ||
| 16 | /// </summary> | ||
| 15 | public static class WixRunner | 17 | public static class WixRunner |
| 16 | { | 18 | { |
| 19 | /// <summary> | ||
| 20 | /// Emulates calling wix.exe with standard backends. | ||
| 21 | /// </summary> | ||
| 22 | /// <param name="args"></param> | ||
| 23 | /// <param name="messages"></param> | ||
| 24 | /// <returns></returns> | ||
| 17 | public static int Execute(string[] args, out List<Message> messages) | 25 | public static int Execute(string[] args, out List<Message> messages) |
| 18 | { | 26 | { |
| 19 | var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); | 27 | var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); |
| @@ -21,6 +29,11 @@ namespace WixToolset.Core.TestPackage | |||
| 21 | return task.Result; | 29 | return task.Result; |
| 22 | } | 30 | } |
| 23 | 31 | ||
| 32 | /// <summary> | ||
| 33 | /// Emulates calling wix.exe with standard backends. | ||
| 34 | /// </summary> | ||
| 35 | /// <param name="args"></param> | ||
| 36 | /// <returns></returns> | ||
| 24 | public static WixRunnerResult Execute(params string[] args) | 37 | public static WixRunnerResult Execute(params string[] args) |
| 25 | { | 38 | { |
| 26 | var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); | 39 | var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); |
| @@ -28,6 +41,13 @@ namespace WixToolset.Core.TestPackage | |||
| 28 | return new WixRunnerResult { ExitCode = exitCode.Result, Messages = messages.ToArray() }; | 41 | return new WixRunnerResult { ExitCode = exitCode.Result, Messages = messages.ToArray() }; |
| 29 | } | 42 | } |
| 30 | 43 | ||
| 44 | /// <summary> | ||
| 45 | /// Emulates calling wix.exe with standard backends. | ||
| 46 | /// </summary> | ||
| 47 | /// <param name="args"></param> | ||
| 48 | /// <param name="coreProvider"></param> | ||
| 49 | /// <param name="messages"></param> | ||
| 50 | /// <returns></returns> | ||
| 31 | public static Task<int> Execute(string[] args, IWixToolsetCoreServiceProvider coreProvider, out List<Message> messages) | 51 | public static Task<int> Execute(string[] args, IWixToolsetCoreServiceProvider coreProvider, out List<Message> messages) |
| 32 | { | 52 | { |
| 33 | coreProvider.AddWindowsInstallerBackend() | 53 | coreProvider.AddWindowsInstallerBackend() |
diff --git a/src/WixToolset.Core.TestPackage/WixRunnerResult.cs b/src/WixToolset.Core.TestPackage/WixRunnerResult.cs index 88f20158..13e3a9e0 100644 --- a/src/WixToolset.Core.TestPackage/WixRunnerResult.cs +++ b/src/WixToolset.Core.TestPackage/WixRunnerResult.cs | |||
| @@ -7,12 +7,25 @@ namespace WixToolset.Core.TestPackage | |||
| 7 | using WixToolset.Data; | 7 | using WixToolset.Data; |
| 8 | using Xunit; | 8 | using Xunit; |
| 9 | 9 | ||
| 10 | /// <summary> | ||
| 11 | /// The result of an Execute method of <see cref="WixRunner"/>. | ||
| 12 | /// </summary> | ||
| 10 | public class WixRunnerResult | 13 | public class WixRunnerResult |
| 11 | { | 14 | { |
| 15 | /// <summary> | ||
| 16 | /// ExitCode for the operation. | ||
| 17 | /// </summary> | ||
| 12 | public int ExitCode { get; set; } | 18 | public int ExitCode { get; set; } |
| 13 | 19 | ||
| 20 | /// <summary> | ||
| 21 | /// Messages from the operation. | ||
| 22 | /// </summary> | ||
| 14 | public Message[] Messages { get; set; } | 23 | public Message[] Messages { get; set; } |
| 15 | 24 | ||
| 25 | /// <summary> | ||
| 26 | /// | ||
| 27 | /// </summary> | ||
| 28 | /// <returns></returns> | ||
| 16 | public WixRunnerResult AssertSuccess() | 29 | public WixRunnerResult AssertSuccess() |
| 17 | { | 30 | { |
| 18 | Assert.True(0 == this.ExitCode, $"\r\n\r\nWixRunner failed with exit code: {this.ExitCode}\r\n Output: {String.Join("\r\n ", FormatMessages(this.Messages))}\r\n"); | 31 | Assert.True(0 == this.ExitCode, $"\r\n\r\nWixRunner failed with exit code: {this.ExitCode}\r\n Output: {String.Join("\r\n ", FormatMessages(this.Messages))}\r\n"); |
diff --git a/src/WixToolset.Core.TestPackage/WixToolset.Core.TestPackage.csproj b/src/WixToolset.Core.TestPackage/WixToolset.Core.TestPackage.csproj index 06793ffd..b64b4075 100644 --- a/src/WixToolset.Core.TestPackage/WixToolset.Core.TestPackage.csproj +++ b/src/WixToolset.Core.TestPackage/WixToolset.Core.TestPackage.csproj | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | <Description>Internal WiX Toolset Test Package</Description> | 8 | <Description>Internal WiX Toolset Test Package</Description> |
| 9 | <DebugType>embedded</DebugType> | 9 | <DebugType>embedded</DebugType> |
| 10 | <PublishRepositoryUrl>true</PublishRepositoryUrl> | 10 | <PublishRepositoryUrl>true</PublishRepositoryUrl> |
| 11 | <CreateDocumentationFile>true</CreateDocumentationFile> | ||
| 11 | </PropertyGroup> | 12 | </PropertyGroup> |
| 12 | 13 | ||
| 13 | <ItemGroup> | 14 | <ItemGroup> |
diff --git a/src/WixToolset.Core.TestPackage/XmlNodeExtensions.cs b/src/WixToolset.Core.TestPackage/XmlNodeExtensions.cs index a7f04508..f4966f74 100644 --- a/src/WixToolset.Core.TestPackage/XmlNodeExtensions.cs +++ b/src/WixToolset.Core.TestPackage/XmlNodeExtensions.cs | |||
| @@ -7,13 +7,28 @@ namespace WixToolset.Core.TestPackage | |||
| 7 | using System.Text.RegularExpressions; | 7 | using System.Text.RegularExpressions; |
| 8 | using System.Xml; | 8 | using System.Xml; |
| 9 | 9 | ||
| 10 | /// <summary> | ||
| 11 | /// Utility class to help compare XML in tests using string comparisons by using single quotes and stripping all namespaces. | ||
| 12 | /// </summary> | ||
| 10 | public static class XmlNodeExtensions | 13 | public static class XmlNodeExtensions |
| 11 | { | 14 | { |
| 15 | /// <summary> | ||
| 16 | /// Returns the node's outer XML using single quotes and stripping all namespaces. | ||
| 17 | /// </summary> | ||
| 18 | /// <param name="node"></param> | ||
| 19 | /// <param name="ignoredAttributesByElementName">Attributes for which the value should be set to '*'.</param> | ||
| 20 | /// <returns></returns> | ||
| 12 | public static string GetTestXml(this XmlNode node, Dictionary<string, List<string>> ignoredAttributesByElementName = null) | 21 | public static string GetTestXml(this XmlNode node, Dictionary<string, List<string>> ignoredAttributesByElementName = null) |
| 13 | { | 22 | { |
| 14 | return node.OuterXml.GetTestXml(ignoredAttributesByElementName); | 23 | return node.OuterXml.GetTestXml(ignoredAttributesByElementName); |
| 15 | } | 24 | } |
| 16 | 25 | ||
| 26 | /// <summary> | ||
| 27 | /// Returns the XML using single quotes and stripping all namespaces. | ||
| 28 | /// </summary> | ||
| 29 | /// <param name="xml"></param> | ||
| 30 | /// <param name="ignoredAttributesByElementName">Attributes for which the value should be set to '*'.</param> | ||
| 31 | /// <returns></returns> | ||
| 17 | public static string GetTestXml(this string xml, Dictionary<string, List<string>> ignoredAttributesByElementName = null) | 32 | public static string GetTestXml(this string xml, Dictionary<string, List<string>> ignoredAttributesByElementName = null) |
| 18 | { | 33 | { |
| 19 | string formattedXml; | 34 | string formattedXml; |
