diff options
Diffstat (limited to 'src/WixToolset.Core.TestPackage/XmlNodeExtensions.cs')
-rw-r--r-- | src/WixToolset.Core.TestPackage/XmlNodeExtensions.cs | 15 |
1 files changed, 15 insertions, 0 deletions
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; |