diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2022-06-15 17:07:46 -0500 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2022-06-15 18:27:22 -0500 |
commit | 09501680d4fcef277b33200c702ce409e9f9c1ef (patch) | |
tree | c355a88295eaedd8992561c7f4c3bf374520afb2 | |
parent | ec61ceb6b2bc0b6cf12259e08c1f8db2a9335773 (diff) | |
download | wix-09501680d4fcef277b33200c702ce409e9f9c1ef.tar.gz wix-09501680d4fcef277b33200c702ce409e9f9c1ef.tar.bz2 wix-09501680d4fcef277b33200c702ce409e9f9c1ef.zip |
Use WixAssert in more places.
47 files changed, 605 insertions, 539 deletions
diff --git a/src/api/wix/test/WixToolsetTest.Data/WindowsInstallerTableDefinitionsFixture.cs b/src/api/wix/test/WixToolsetTest.Data/WindowsInstallerTableDefinitionsFixture.cs index 5621a756..efb777ee 100644 --- a/src/api/wix/test/WixToolsetTest.Data/WindowsInstallerTableDefinitionsFixture.cs +++ b/src/api/wix/test/WixToolsetTest.Data/WindowsInstallerTableDefinitionsFixture.cs | |||
@@ -2,6 +2,7 @@ | |||
2 | 2 | ||
3 | namespace WixToolsetTest.Data | 3 | namespace WixToolsetTest.Data |
4 | { | 4 | { |
5 | using WixBuildTools.TestSupport; | ||
5 | using WixToolset.Data.WindowsInstaller; | 6 | using WixToolset.Data.WindowsInstaller; |
6 | using Xunit; | 7 | using Xunit; |
7 | 8 | ||
@@ -21,7 +22,7 @@ namespace WixToolsetTest.Data | |||
21 | Assert.Equal(expectedRowType, rowFromTableDefinition.GetType()); | 22 | Assert.Equal(expectedRowType, rowFromTableDefinition.GetType()); |
22 | if (typeof(Row) != expectedRowType) | 23 | if (typeof(Row) != expectedRowType) |
23 | { | 24 | { |
24 | Assert.Equal(expectedRowTypeName, expectedRowType.Name); | 25 | WixAssert.StringEqual(expectedRowTypeName, expectedRowType.Name); |
25 | } | 26 | } |
26 | } | 27 | } |
27 | } | 28 | } |
diff --git a/src/ext/Bal/test/WixToolsetTest.Bal/BalExtensionFixture.cs b/src/ext/Bal/test/WixToolsetTest.Bal/BalExtensionFixture.cs index 43484855..d8197467 100644 --- a/src/ext/Bal/test/WixToolsetTest.Bal/BalExtensionFixture.cs +++ b/src/ext/Bal/test/WixToolsetTest.Bal/BalExtensionFixture.cs | |||
@@ -41,9 +41,11 @@ namespace WixToolsetTest.Bal | |||
41 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFile, baFolderPath, extractFolderPath); | 41 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFile, baFolderPath, extractFolderPath); |
42 | extractResult.AssertSuccess(); | 42 | extractResult.AssertSuccess(); |
43 | 43 | ||
44 | var balPackageInfos = extractResult.SelectBADataNodes("/ba:BootstrapperApplicationData/ba:WixBalPackageInfo"); | 44 | var balPackageInfos = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixBalPackageInfo"); |
45 | var balPackageInfo = (XmlNode)Assert.Single(balPackageInfos); | 45 | WixAssert.CompareLineByLine(new string[] |
46 | Assert.Equal("<WixBalPackageInfo PackageId='test.msi' DisplayInternalUICondition='1' />", balPackageInfo.GetTestXml()); | 46 | { |
47 | "<WixBalPackageInfo PackageId='test.msi' DisplayInternalUICondition='1' />", | ||
48 | }, balPackageInfos); | ||
47 | 49 | ||
48 | Assert.True(File.Exists(Path.Combine(baFolderPath, "thm.wxl"))); | 50 | Assert.True(File.Exists(Path.Combine(baFolderPath, "thm.wxl"))); |
49 | } | 51 | } |
@@ -76,9 +78,11 @@ namespace WixToolsetTest.Bal | |||
76 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFile, baFolderPath, extractFolderPath); | 78 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFile, baFolderPath, extractFolderPath); |
77 | extractResult.AssertSuccess(); | 79 | extractResult.AssertSuccess(); |
78 | 80 | ||
79 | var balOverridableVariables = extractResult.SelectBADataNodes("/ba:BootstrapperApplicationData/ba:WixStdbaOverridableVariable"); | 81 | var balOverridableVariables = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixStdbaOverridableVariable"); |
80 | var balOverridableVariable = (XmlNode)Assert.Single(balOverridableVariables); | 82 | WixAssert.CompareLineByLine(new[] |
81 | Assert.Equal("<WixStdbaOverridableVariable Name='TEST1' />", balOverridableVariable.GetTestXml()); | 83 | { |
84 | "<WixStdbaOverridableVariable Name='TEST1' />", | ||
85 | }, balOverridableVariables); | ||
82 | } | 86 | } |
83 | } | 87 | } |
84 | 88 | ||
@@ -134,9 +138,11 @@ namespace WixToolsetTest.Bal | |||
134 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFile, baFolderPath, extractFolderPath); | 138 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFile, baFolderPath, extractFolderPath); |
135 | extractResult.AssertSuccess(); | 139 | extractResult.AssertSuccess(); |
136 | 140 | ||
137 | var wixMbaPrereqOptionsElements = extractResult.SelectBADataNodes("/ba:BootstrapperApplicationData/ba:WixMbaPrereqOptions"); | 141 | var wixMbaPrereqOptionsElements = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixMbaPrereqOptions"); |
138 | var wixMbaPrereqOptions = (XmlNode)Assert.Single(wixMbaPrereqOptionsElements); | 142 | WixAssert.CompareLineByLine(new[] |
139 | Assert.Equal("<WixMbaPrereqOptions AlwaysInstallPrereqs='1' />", wixMbaPrereqOptions.GetTestXml()); | 143 | { |
144 | "<WixMbaPrereqOptions AlwaysInstallPrereqs='1' />", | ||
145 | }, wixMbaPrereqOptionsElements); | ||
140 | } | 146 | } |
141 | } | 147 | } |
142 | 148 | ||
@@ -159,7 +165,7 @@ namespace WixToolsetTest.Bal | |||
159 | "-o", bundleFile, | 165 | "-o", bundleFile, |
160 | }); | 166 | }); |
161 | Assert.Equal(6802, compileResult.ExitCode); | 167 | Assert.Equal(6802, compileResult.ExitCode); |
162 | Assert.Equal("There must be at least one PrereqPackage when using the ManagedBootstrapperApplicationHost.\nThis is typically done by using the WixNetFxExtension and referencing one of the NetFxAsPrereq package groups.", compileResult.Messages[0].ToString()); | 168 | WixAssert.StringEqual("There must be at least one PrereqPackage when using the ManagedBootstrapperApplicationHost.\nThis is typically done by using the WixNetFxExtension and referencing one of the NetFxAsPrereq package groups.", compileResult.Messages[0].ToString()); |
163 | 169 | ||
164 | Assert.False(File.Exists(bundleFile)); | 170 | Assert.False(File.Exists(bundleFile)); |
165 | Assert.False(File.Exists(Path.Combine(intermediateFolder, "test.exe"))); | 171 | Assert.False(File.Exists(Path.Combine(intermediateFolder, "test.exe"))); |
diff --git a/src/wix/WixToolset.Core.TestPackage/ExtractBAContainerResult.cs b/src/wix/WixToolset.Core.TestPackage/ExtractBAContainerResult.cs index 65528fe0..5f4a5369 100644 --- a/src/wix/WixToolset.Core.TestPackage/ExtractBAContainerResult.cs +++ b/src/wix/WixToolset.Core.TestPackage/ExtractBAContainerResult.cs | |||
@@ -2,6 +2,7 @@ | |||
2 | 2 | ||
3 | namespace WixToolset.Core.TestPackage | 3 | namespace WixToolset.Core.TestPackage |
4 | { | 4 | { |
5 | using System.Collections.Generic; | ||
5 | using System.IO; | 6 | using System.IO; |
6 | using System.Xml; | 7 | using System.Xml; |
7 | using Xunit; | 8 | using Xunit; |
@@ -102,6 +103,17 @@ namespace WixToolset.Core.TestPackage | |||
102 | /// <summary> | 103 | /// <summary> |
103 | /// | 104 | /// |
104 | /// </summary> | 105 | /// </summary> |
106 | /// <param name="xpath">elements must have the 'ba' prefix</param> | ||
107 | /// <param name="ignoredAttributesByElementName">Attributes for which the value should be set to '*'.</param> | ||
108 | /// <returns></returns> | ||
109 | public string[] GetBADataTestXmlLines(string xpath, Dictionary<string, List<string>> ignoredAttributesByElementName = null) | ||
110 | { | ||
111 | return this.SelectBADataNodes(xpath).GetTestXmlLines(ignoredAttributesByElementName); | ||
112 | } | ||
113 | |||
114 | /// <summary> | ||
115 | /// | ||
116 | /// </summary> | ||
105 | /// <param name="xpath">elements must have the 'be' prefix</param> | 117 | /// <param name="xpath">elements must have the 'be' prefix</param> |
106 | /// <returns></returns> | 118 | /// <returns></returns> |
107 | public XmlNodeList SelectBundleExtensionDataNodes(string xpath) | 119 | public XmlNodeList SelectBundleExtensionDataNodes(string xpath) |
@@ -112,11 +124,33 @@ namespace WixToolset.Core.TestPackage | |||
112 | /// <summary> | 124 | /// <summary> |
113 | /// | 125 | /// |
114 | /// </summary> | 126 | /// </summary> |
127 | /// <param name="xpath">elements must have the 'be' prefix</param> | ||
128 | /// <param name="ignoredAttributesByElementName">Attributes for which the value should be set to '*'.</param> | ||
129 | /// <returns></returns> | ||
130 | public string[] GetBundleExtensionTestXmlLines(string xpath, Dictionary<string, List<string>> ignoredAttributesByElementName = null) | ||
131 | { | ||
132 | return this.SelectBundleExtensionDataNodes(xpath).GetTestXmlLines(ignoredAttributesByElementName); | ||
133 | } | ||
134 | |||
135 | /// <summary> | ||
136 | /// | ||
137 | /// </summary> | ||
115 | /// <param name="xpath">elements must have the 'burn' prefix</param> | 138 | /// <param name="xpath">elements must have the 'burn' prefix</param> |
116 | /// <returns></returns> | 139 | /// <returns></returns> |
117 | public XmlNodeList SelectManifestNodes(string xpath) | 140 | public XmlNodeList SelectManifestNodes(string xpath) |
118 | { | 141 | { |
119 | return this.ManifestDocument.SelectNodes(xpath, this.ManifestNamespaceManager); | 142 | return this.ManifestDocument.SelectNodes(xpath, this.ManifestNamespaceManager); |
120 | } | 143 | } |
144 | |||
145 | /// <summary> | ||
146 | /// | ||
147 | /// </summary> | ||
148 | /// <param name="xpath">elements must have the 'burn' prefix</param> | ||
149 | /// <param name="ignoredAttributesByElementName">Attributes for which the value should be set to '*'.</param> | ||
150 | /// <returns></returns> | ||
151 | public string[] GetManifestTestXmlLines(string xpath, Dictionary<string, List<string>> ignoredAttributesByElementName = null) | ||
152 | { | ||
153 | return this.SelectManifestNodes(xpath).GetTestXmlLines(ignoredAttributesByElementName); | ||
154 | } | ||
121 | } | 155 | } |
122 | } | 156 | } |
diff --git a/src/wix/WixToolset.Core.TestPackage/XmlNodeExtensions.cs b/src/wix/WixToolset.Core.TestPackage/XmlNodeExtensions.cs index b269fb25..2f4c1aa3 100644 --- a/src/wix/WixToolset.Core.TestPackage/XmlNodeExtensions.cs +++ b/src/wix/WixToolset.Core.TestPackage/XmlNodeExtensions.cs | |||
@@ -4,6 +4,7 @@ namespace WixToolset.Core.TestPackage | |||
4 | { | 4 | { |
5 | using System.Collections.Generic; | 5 | using System.Collections.Generic; |
6 | using System.IO; | 6 | using System.IO; |
7 | using System.Linq; | ||
7 | using System.Text.RegularExpressions; | 8 | using System.Text.RegularExpressions; |
8 | using System.Xml; | 9 | using System.Xml; |
9 | 10 | ||
@@ -61,6 +62,19 @@ namespace WixToolset.Core.TestPackage | |||
61 | return Regex.Replace(formattedXml, " xmlns(:[^=]+)?='[^']*'", ""); | 62 | return Regex.Replace(formattedXml, " xmlns(:[^=]+)?='[^']*'", ""); |
62 | } | 63 | } |
63 | 64 | ||
65 | /// <summary> | ||
66 | /// Returns the XML for each node using single quotes and stripping all namespaces. | ||
67 | /// </summary> | ||
68 | /// <param name="nodeList"></param> | ||
69 | /// <param name="ignoredAttributesByElementName">Attributes for which the value should be set to '*'.</param> | ||
70 | /// <returns></returns> | ||
71 | public static string[] GetTestXmlLines(this XmlNodeList nodeList, Dictionary<string, List<string>> ignoredAttributesByElementName = null) | ||
72 | { | ||
73 | return nodeList.Cast<XmlNode>() | ||
74 | .Select(x => x.GetTestXml(ignoredAttributesByElementName)) | ||
75 | .ToArray(); | ||
76 | } | ||
77 | |||
64 | private static void HandleIgnoredAttributes(XmlNode node, Dictionary<string, List<string>> ignoredAttributesByElementName) | 78 | private static void HandleIgnoredAttributes(XmlNode node, Dictionary<string, List<string>> ignoredAttributesByElementName) |
65 | { | 79 | { |
66 | if (node.Attributes != null && ignoredAttributesByElementName.TryGetValue(node.LocalName, out var ignoredAttributes)) | 80 | if (node.Attributes != null && ignoredAttributesByElementName.TryGetValue(node.LocalName, out var ignoredAttributes)) |
diff --git a/src/wix/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs b/src/wix/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs index 9d132f66..f158e3f2 100644 --- a/src/wix/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs +++ b/src/wix/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs | |||
@@ -59,8 +59,8 @@ namespace WixToolsetTest.BuildTasks | |||
59 | var section = intermediate.Sections.Single(); | 59 | var section = intermediate.Sections.Single(); |
60 | 60 | ||
61 | var fileSymbol = section.Symbols.OfType<FileSymbol>().Single(); | 61 | var fileSymbol = section.Symbols.OfType<FileSymbol>().Single(); |
62 | Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path); | 62 | WixAssert.StringEqual(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path); |
63 | Assert.Equal(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); | 63 | WixAssert.StringEqual(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); |
64 | } | 64 | } |
65 | } | 65 | } |
66 | } | 66 | } |
diff --git a/src/wix/test/WixToolsetTest.Converters.Symbolizer/ConvertSymbolsFixture.cs b/src/wix/test/WixToolsetTest.Converters.Symbolizer/ConvertSymbolsFixture.cs index 01213524..9fb47a9a 100644 --- a/src/wix/test/WixToolsetTest.Converters.Symbolizer/ConvertSymbolsFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters.Symbolizer/ConvertSymbolsFixture.cs | |||
@@ -63,8 +63,8 @@ namespace WixToolsetTest.Converters.Symbolizer | |||
63 | .OrderBy(s => s) | 63 | .OrderBy(s => s) |
64 | .ToArray(); | 64 | .ToArray(); |
65 | 65 | ||
66 | #if false | 66 | #if true |
67 | Assert.Equal(wix3Dump, wix4Dump); | 67 | WixAssert.CompareLineByLine(wix3Dump, wix4Dump); |
68 | #else // useful when you want to diff the outputs with another diff tool. | 68 | #else // useful when you want to diff the outputs with another diff tool. |
69 | var wix3TextDump = String.Join(Environment.NewLine, wix3Dump); | 69 | var wix3TextDump = String.Join(Environment.NewLine, wix3Dump); |
70 | var wix4TextDump = String.Join(Environment.NewLine, wix4Dump); | 70 | var wix4TextDump = String.Join(Environment.NewLine, wix4Dump); |
@@ -75,7 +75,7 @@ namespace WixToolsetTest.Converters.Symbolizer | |||
75 | File.WriteAllText(path3, wix3TextDump); | 75 | File.WriteAllText(path3, wix3TextDump); |
76 | File.WriteAllText(path4, wix4TextDump); | 76 | File.WriteAllText(path4, wix4TextDump); |
77 | 77 | ||
78 | Assert.Equal(wix3TextDump, wix4TextDump); | 78 | WixAssert.StringEqual(wix3TextDump, wix4TextDump); |
79 | #endif | 79 | #endif |
80 | } | 80 | } |
81 | } | 81 | } |
diff --git a/src/wix/test/WixToolsetTest.Converters/BaseConverterFixture.cs b/src/wix/test/WixToolsetTest.Converters/BaseConverterFixture.cs index 2421d73b..c6176973 100644 --- a/src/wix/test/WixToolsetTest.Converters/BaseConverterFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/BaseConverterFixture.cs | |||
@@ -7,7 +7,6 @@ namespace WixToolsetTest.Converters | |||
7 | using System.Text; | 7 | using System.Text; |
8 | using System.Xml; | 8 | using System.Xml; |
9 | using System.Xml.Linq; | 9 | using System.Xml.Linq; |
10 | using Xunit; | ||
11 | 10 | ||
12 | public abstract class BaseConverterFixture | 11 | public abstract class BaseConverterFixture |
13 | { | 12 | { |
diff --git a/src/wix/test/WixToolsetTest.Converters/ConverterFixture.cs b/src/wix/test/WixToolsetTest.Converters/ConverterFixture.cs index 13df9da7..d186931b 100644 --- a/src/wix/test/WixToolsetTest.Converters/ConverterFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/ConverterFixture.cs | |||
@@ -4,6 +4,7 @@ namespace WixToolsetTest.Converters | |||
4 | { | 4 | { |
5 | using System; | 5 | using System; |
6 | using System.Xml.Linq; | 6 | using System.Xml.Linq; |
7 | using WixBuildTools.TestSupport; | ||
7 | using WixToolset.Converters; | 8 | using WixToolset.Converters; |
8 | using WixToolsetTest.Converters.Mocks; | 9 | using WixToolsetTest.Converters.Mocks; |
9 | using Xunit; | 10 | using Xunit; |
@@ -21,10 +22,12 @@ namespace WixToolsetTest.Converters | |||
21 | " <Fragment />", | 22 | " <Fragment />", |
22 | "</Wix>"); | 23 | "</Wix>"); |
23 | 24 | ||
24 | var expected = String.Join(Environment.NewLine, | 25 | var expected = new[] |
26 | { | ||
25 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | 27 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", |
26 | " <Fragment />", | 28 | " <Fragment />", |
27 | "</Wix>"); | 29 | "</Wix>", |
30 | }; | ||
28 | 31 | ||
29 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 32 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
30 | 33 | ||
@@ -33,10 +36,10 @@ namespace WixToolsetTest.Converters | |||
33 | 36 | ||
34 | var errors = converter.ConvertDocument(document); | 37 | var errors = converter.ConvertDocument(document); |
35 | 38 | ||
36 | var actual = UnformattedDocumentString(document); | 39 | var actual = UnformattedDocumentLines(document); |
37 | 40 | ||
38 | Assert.Equal(1, errors); | 41 | Assert.Equal(1, errors); |
39 | Assert.Equal(expected, actual); | 42 | WixAssert.CompareLineByLine(expected, actual); |
40 | } | 43 | } |
41 | 44 | ||
42 | [Fact] | 45 | [Fact] |
@@ -48,11 +51,13 @@ namespace WixToolsetTest.Converters | |||
48 | " <Fragment />", | 51 | " <Fragment />", |
49 | "</Wix>"); | 52 | "</Wix>"); |
50 | 53 | ||
51 | var expected = String.Join(Environment.NewLine, | 54 | var expected = new[] |
55 | { | ||
52 | "<?xml version=\"1.0\" encoding=\"utf-16\"?>", | 56 | "<?xml version=\"1.0\" encoding=\"utf-16\"?>", |
53 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | 57 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", |
54 | " <Fragment />", | 58 | " <Fragment />", |
55 | "</Wix>"); | 59 | "</Wix>", |
60 | }; | ||
56 | 61 | ||
57 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 62 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
58 | 63 | ||
@@ -61,10 +66,10 @@ namespace WixToolsetTest.Converters | |||
61 | 66 | ||
62 | var errors = converter.ConvertDocument(document); | 67 | var errors = converter.ConvertDocument(document); |
63 | 68 | ||
64 | var actual = UnformattedDocumentString(document, omitXmlDeclaration: false); | 69 | var actual = UnformattedDocumentLines(document, omitXmlDeclaration: false); |
65 | 70 | ||
66 | Assert.Equal(0, errors); | 71 | Assert.Equal(0, errors); |
67 | Assert.Equal(expected, actual); | 72 | WixAssert.CompareLineByLine(expected, actual); |
68 | } | 73 | } |
69 | 74 | ||
70 | [Fact] | 75 | [Fact] |
@@ -76,10 +81,12 @@ namespace WixToolsetTest.Converters | |||
76 | " <Fragment />", | 81 | " <Fragment />", |
77 | "</Wix>"); | 82 | "</Wix>"); |
78 | 83 | ||
79 | var expected = String.Join(Environment.NewLine, | 84 | var expected = new[] |
85 | { | ||
80 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | 86 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", |
81 | " <Fragment />", | 87 | " <Fragment />", |
82 | "</Wix>"); | 88 | "</Wix>", |
89 | }; | ||
83 | 90 | ||
84 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 91 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
85 | 92 | ||
@@ -88,11 +95,11 @@ namespace WixToolsetTest.Converters | |||
88 | 95 | ||
89 | var errors = converter.ConvertDocument(document); | 96 | var errors = converter.ConvertDocument(document); |
90 | 97 | ||
91 | var actual = UnformattedDocumentString(document); | 98 | var actual = UnformattedDocumentLines(document); |
92 | 99 | ||
93 | Assert.Equal(2, errors); | 100 | Assert.Equal(2, errors); |
94 | //Assert.Equal(Wix4Namespace, document.Root.GetDefaultNamespace()); | 101 | //Assert.Equal(Wix4Namespace, document.Root.GetDefaultNamespace()); |
95 | Assert.Equal(expected, actual); | 102 | WixAssert.CompareLineByLine(expected, actual); |
96 | } | 103 | } |
97 | 104 | ||
98 | [Fact] | 105 | [Fact] |
@@ -104,10 +111,12 @@ namespace WixToolsetTest.Converters | |||
104 | " <w:Fragment />", | 111 | " <w:Fragment />", |
105 | "</w:Wix>"); | 112 | "</w:Wix>"); |
106 | 113 | ||
107 | var expected = String.Join(Environment.NewLine, | 114 | var expected = new[] |
115 | { | ||
108 | "<w:Wix xmlns:w=\"http://wixtoolset.org/schemas/v4/wxs\">", | 116 | "<w:Wix xmlns:w=\"http://wixtoolset.org/schemas/v4/wxs\">", |
109 | " <w:Fragment />", | 117 | " <w:Fragment />", |
110 | "</w:Wix>"); | 118 | "</w:Wix>", |
119 | }; | ||
111 | 120 | ||
112 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 121 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
113 | 122 | ||
@@ -116,10 +125,10 @@ namespace WixToolsetTest.Converters | |||
116 | 125 | ||
117 | var errors = converter.ConvertDocument(document); | 126 | var errors = converter.ConvertDocument(document); |
118 | 127 | ||
119 | var actual = UnformattedDocumentString(document); | 128 | var actual = UnformattedDocumentLines(document); |
120 | 129 | ||
121 | Assert.Equal(2, errors); | 130 | Assert.Equal(2, errors); |
122 | Assert.Equal(expected, actual); | 131 | WixAssert.CompareLineByLine(expected, actual); |
123 | Assert.Equal(Wix4Namespace, document.Root.GetNamespaceOfPrefix("w")); | 132 | Assert.Equal(Wix4Namespace, document.Root.GetNamespaceOfPrefix("w")); |
124 | } | 133 | } |
125 | 134 | ||
@@ -134,12 +143,14 @@ namespace WixToolsetTest.Converters | |||
134 | " </w:Fragment>", | 143 | " </w:Fragment>", |
135 | "</w:Wix>"); | 144 | "</w:Wix>"); |
136 | 145 | ||
137 | var expected = String.Join(Environment.NewLine, | 146 | var expected = new[] |
147 | { | ||
138 | "<w:Wix xmlns:w=\"http://wixtoolset.org/schemas/v4/wxs\" xmlns=\"http://wixtoolset.org/schemas/v4/wxs/util\">", | 148 | "<w:Wix xmlns:w=\"http://wixtoolset.org/schemas/v4/wxs\" xmlns=\"http://wixtoolset.org/schemas/v4/wxs/util\">", |
139 | " <w:Fragment>", | 149 | " <w:Fragment>", |
140 | " <Test />", | 150 | " <Test />", |
141 | " </w:Fragment>", | 151 | " </w:Fragment>", |
142 | "</w:Wix>"); | 152 | "</w:Wix>", |
153 | }; | ||
143 | 154 | ||
144 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 155 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
145 | 156 | ||
@@ -148,9 +159,9 @@ namespace WixToolsetTest.Converters | |||
148 | 159 | ||
149 | var errors = converter.ConvertDocument(document); | 160 | var errors = converter.ConvertDocument(document); |
150 | 161 | ||
151 | var actual = UnformattedDocumentString(document); | 162 | var actual = UnformattedDocumentLines(document); |
152 | 163 | ||
153 | Assert.Equal(expected, actual); | 164 | WixAssert.CompareLineByLine(expected, actual); |
154 | Assert.Equal(3, errors); | 165 | Assert.Equal(3, errors); |
155 | Assert.Equal(Wix4Namespace, document.Root.GetNamespaceOfPrefix("w")); | 166 | Assert.Equal(Wix4Namespace, document.Root.GetNamespaceOfPrefix("w")); |
156 | Assert.Equal("http://wixtoolset.org/schemas/v4/wxs/util", document.Root.GetDefaultNamespace()); | 167 | Assert.Equal("http://wixtoolset.org/schemas/v4/wxs/util", document.Root.GetDefaultNamespace()); |
@@ -165,10 +176,12 @@ namespace WixToolsetTest.Converters | |||
165 | " <Fragment />", | 176 | " <Fragment />", |
166 | "</Wix>"); | 177 | "</Wix>"); |
167 | 178 | ||
168 | var expected = String.Join(Environment.NewLine, | 179 | var expected = new[] |
180 | { | ||
169 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | 181 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", |
170 | " <Fragment />", | 182 | " <Fragment />", |
171 | "</Wix>"); | 183 | "</Wix>", |
184 | }; | ||
172 | 185 | ||
173 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 186 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
174 | 187 | ||
@@ -177,10 +190,10 @@ namespace WixToolsetTest.Converters | |||
177 | 190 | ||
178 | var errors = converter.ConvertDocument(document); | 191 | var errors = converter.ConvertDocument(document); |
179 | 192 | ||
180 | var actual = UnformattedDocumentString(document); | 193 | var actual = UnformattedDocumentLines(document); |
181 | 194 | ||
182 | Assert.Equal(4, errors); | 195 | Assert.Equal(4, errors); |
183 | Assert.Equal(expected, actual); | 196 | WixAssert.CompareLineByLine(expected, actual); |
184 | Assert.Equal(Wix4Namespace, document.Root.GetDefaultNamespace()); | 197 | Assert.Equal(Wix4Namespace, document.Root.GetDefaultNamespace()); |
185 | } | 198 | } |
186 | 199 | ||
@@ -193,10 +206,12 @@ namespace WixToolsetTest.Converters | |||
193 | " <Fragment />", | 206 | " <Fragment />", |
194 | "</Wix>"); | 207 | "</Wix>"); |
195 | 208 | ||
196 | var expected = String.Join(Environment.NewLine, | 209 | var expected = new[] |
210 | { | ||
197 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | 211 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", |
198 | " <Fragment />", | 212 | " <Fragment />", |
199 | "</Wix>"); | 213 | "</Wix>", |
214 | }; | ||
200 | 215 | ||
201 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 216 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
202 | 217 | ||
@@ -205,10 +220,10 @@ namespace WixToolsetTest.Converters | |||
205 | 220 | ||
206 | var errors = converter.ConvertDocument(document); | 221 | var errors = converter.ConvertDocument(document); |
207 | 222 | ||
208 | var actual = UnformattedDocumentString(document); | 223 | var actual = UnformattedDocumentLines(document); |
209 | 224 | ||
210 | Assert.Equal(2, errors); | 225 | Assert.Equal(2, errors); |
211 | Assert.Equal(expected, actual); | 226 | WixAssert.CompareLineByLine(expected, actual); |
212 | Assert.Equal(Wix4Namespace, document.Root.GetDefaultNamespace()); | 227 | Assert.Equal(Wix4Namespace, document.Root.GetDefaultNamespace()); |
213 | } | 228 | } |
214 | 229 | ||
@@ -226,7 +241,8 @@ namespace WixToolsetTest.Converters | |||
226 | " </Fragment>", | 241 | " </Fragment>", |
227 | "</Include>"); | 242 | "</Include>"); |
228 | 243 | ||
229 | var expected = String.Join(Environment.NewLine, | 244 | var expected = new[] |
245 | { | ||
230 | "<Include xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | 246 | "<Include xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", |
231 | " <?define Version = 1.2.3 ?>", | 247 | " <?define Version = 1.2.3 ?>", |
232 | " <Fragment>", | 248 | " <Fragment>", |
@@ -234,7 +250,8 @@ namespace WixToolsetTest.Converters | |||
234 | " <Directory Id=\"ANOTHERDIR\" Name=\"Another\" />", | 250 | " <Directory Id=\"ANOTHERDIR\" Name=\"Another\" />", |
235 | " </DirectoryRef>", | 251 | " </DirectoryRef>", |
236 | " </Fragment>", | 252 | " </Fragment>", |
237 | "</Include>"); | 253 | "</Include>", |
254 | }; | ||
238 | 255 | ||
239 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 256 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
240 | 257 | ||
@@ -243,10 +260,10 @@ namespace WixToolsetTest.Converters | |||
243 | 260 | ||
244 | var errors = converter.ConvertDocument(document); | 261 | var errors = converter.ConvertDocument(document); |
245 | 262 | ||
246 | var actual = UnformattedDocumentString(document); | 263 | var actual = UnformattedDocumentLines(document); |
247 | 264 | ||
248 | Assert.Equal(2, errors); | 265 | Assert.Equal(2, errors); |
249 | Assert.Equal(expected, actual); | 266 | WixAssert.CompareLineByLine(expected, actual); |
250 | Assert.Equal(Wix4Namespace, document.Root.GetDefaultNamespace()); | 267 | Assert.Equal(Wix4Namespace, document.Root.GetDefaultNamespace()); |
251 | } | 268 | } |
252 | 269 | ||
@@ -259,10 +276,12 @@ namespace WixToolsetTest.Converters | |||
259 | " <File Source='path\\to\\foo.txt' />", | 276 | " <File Source='path\\to\\foo.txt' />", |
260 | "</Wix>"); | 277 | "</Wix>"); |
261 | 278 | ||
262 | var expected = String.Join(Environment.NewLine, | 279 | var expected = new[] |
280 | { | ||
263 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | 281 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", |
264 | " <File Id=\"foo.txt\" Source=\"path\\to\\foo.txt\" />", | 282 | " <File Id=\"foo.txt\" Source=\"path\\to\\foo.txt\" />", |
265 | "</Wix>"); | 283 | "</Wix>", |
284 | }; | ||
266 | 285 | ||
267 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 286 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
268 | 287 | ||
@@ -271,10 +290,10 @@ namespace WixToolsetTest.Converters | |||
271 | 290 | ||
272 | var errors = converter.ConvertDocument(document); | 291 | var errors = converter.ConvertDocument(document); |
273 | 292 | ||
274 | var actual = UnformattedDocumentString(document); | 293 | var actual = UnformattedDocumentLines(document); |
275 | 294 | ||
276 | Assert.Equal(3, errors); | 295 | Assert.Equal(3, errors); |
277 | Assert.Equal(expected, actual); | 296 | WixAssert.CompareLineByLine(expected, actual); |
278 | } | 297 | } |
279 | 298 | ||
280 | [Fact] | 299 | [Fact] |
@@ -286,10 +305,12 @@ namespace WixToolsetTest.Converters | |||
286 | " <Directory ShortName='iamshort' />", | 305 | " <Directory ShortName='iamshort' />", |
287 | "</Wix>"); | 306 | "</Wix>"); |
288 | 307 | ||
289 | var expected = String.Join(Environment.NewLine, | 308 | var expected = new[] |
309 | { | ||
290 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | 310 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", |
291 | " <Directory Name=\"iamshort\" />", | 311 | " <Directory Name=\"iamshort\" />", |
292 | "</Wix>"); | 312 | "</Wix>", |
313 | }; | ||
293 | 314 | ||
294 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 315 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
295 | 316 | ||
@@ -298,10 +319,10 @@ namespace WixToolsetTest.Converters | |||
298 | 319 | ||
299 | var errors = converter.ConvertDocument(document); | 320 | var errors = converter.ConvertDocument(document); |
300 | 321 | ||
301 | var actual = UnformattedDocumentString(document); | 322 | var actual = UnformattedDocumentLines(document); |
302 | 323 | ||
303 | Assert.Equal(2, errors); | 324 | Assert.Equal(2, errors); |
304 | Assert.Equal(expected, actual); | 325 | WixAssert.CompareLineByLine(expected, actual); |
305 | } | 326 | } |
306 | 327 | ||
307 | [Fact] | 328 | [Fact] |
@@ -312,10 +333,12 @@ namespace WixToolsetTest.Converters | |||
312 | " <Catalog Id='idCatalog' SourceFile='path\\to\\catalog.cat' />", | 333 | " <Catalog Id='idCatalog' SourceFile='path\\to\\catalog.cat' />", |
313 | "</Wix>"); | 334 | "</Wix>"); |
314 | 335 | ||
315 | var expected = String.Join(Environment.NewLine, | 336 | var expected = new[] |
337 | { | ||
316 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | 338 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", |
317 | " ", | 339 | " ", |
318 | "</Wix>"); | 340 | "</Wix>", |
341 | }; | ||
319 | 342 | ||
320 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 343 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
321 | 344 | ||
@@ -324,10 +347,10 @@ namespace WixToolsetTest.Converters | |||
324 | 347 | ||
325 | var errors = converter.ConvertDocument(document); | 348 | var errors = converter.ConvertDocument(document); |
326 | 349 | ||
327 | var actual = UnformattedDocumentString(document); | 350 | var actual = UnformattedDocumentLines(document); |
328 | 351 | ||
329 | Assert.Equal(1, errors); | 352 | Assert.Equal(1, errors); |
330 | Assert.Equal(expected, actual); | 353 | WixAssert.CompareLineByLine(expected, actual); |
331 | } | 354 | } |
332 | 355 | ||
333 | [Fact] | 356 | [Fact] |
@@ -338,10 +361,12 @@ namespace WixToolsetTest.Converters | |||
338 | " <MsiPackage SuppressSignatureValidation='no' />", | 361 | " <MsiPackage SuppressSignatureValidation='no' />", |
339 | "</Wix>"); | 362 | "</Wix>"); |
340 | 363 | ||
341 | var expected = String.Join(Environment.NewLine, | 364 | var expected = new[] |
365 | { | ||
342 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | 366 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", |
343 | " <MsiPackage />", | 367 | " <MsiPackage />", |
344 | "</Wix>"); | 368 | "</Wix>", |
369 | }; | ||
345 | 370 | ||
346 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 371 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
347 | 372 | ||
@@ -350,10 +375,10 @@ namespace WixToolsetTest.Converters | |||
350 | 375 | ||
351 | var errors = converter.ConvertDocument(document); | 376 | var errors = converter.ConvertDocument(document); |
352 | 377 | ||
353 | var actual = UnformattedDocumentString(document); | 378 | var actual = UnformattedDocumentLines(document); |
354 | 379 | ||
355 | Assert.Equal(1, errors); | 380 | Assert.Equal(1, errors); |
356 | Assert.Equal(expected, actual); | 381 | WixAssert.CompareLineByLine(expected, actual); |
357 | } | 382 | } |
358 | 383 | ||
359 | [Fact] | 384 | [Fact] |
@@ -364,10 +389,12 @@ namespace WixToolsetTest.Converters | |||
364 | " <Payload SuppressSignatureValidation='yes' />", | 389 | " <Payload SuppressSignatureValidation='yes' />", |
365 | "</Wix>"); | 390 | "</Wix>"); |
366 | 391 | ||
367 | var expected = String.Join(Environment.NewLine, | 392 | var expected = new[] |
393 | { | ||
368 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | 394 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", |
369 | " <Payload />", | 395 | " <Payload />", |
370 | "</Wix>"); | 396 | "</Wix>", |
397 | }; | ||
371 | 398 | ||
372 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 399 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
373 | 400 | ||
@@ -376,10 +403,10 @@ namespace WixToolsetTest.Converters | |||
376 | 403 | ||
377 | var errors = converter.ConvertDocument(document); | 404 | var errors = converter.ConvertDocument(document); |
378 | 405 | ||
379 | var actual = UnformattedDocumentString(document); | 406 | var actual = UnformattedDocumentLines(document); |
380 | 407 | ||
381 | Assert.Equal(1, errors); | 408 | Assert.Equal(1, errors); |
382 | Assert.Equal(expected, actual); | 409 | WixAssert.CompareLineByLine(expected, actual); |
383 | } | 410 | } |
384 | 411 | ||
385 | [Fact] | 412 | [Fact] |
@@ -390,10 +417,12 @@ namespace WixToolsetTest.Converters | |||
390 | " <Verb Target='anything' />", | 417 | " <Verb Target='anything' />", |
391 | "</Wix>"); | 418 | "</Wix>"); |
392 | 419 | ||
393 | var expected = String.Join(Environment.NewLine, | 420 | var expected = new[] |
421 | { | ||
394 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | 422 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", |
395 | " <Verb Target=\"anything\" />", | 423 | " <Verb Target=\"anything\" />", |
396 | "</Wix>"); | 424 | "</Wix>", |
425 | }; | ||
397 | 426 | ||
398 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 427 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
399 | 428 | ||
@@ -402,10 +431,10 @@ namespace WixToolsetTest.Converters | |||
402 | 431 | ||
403 | var errors = converter.ConvertDocument(document); | 432 | var errors = converter.ConvertDocument(document); |
404 | 433 | ||
405 | var actual = UnformattedDocumentString(document); | 434 | var actual = UnformattedDocumentLines(document); |
406 | 435 | ||
407 | Assert.Equal(2, errors); | 436 | Assert.Equal(2, errors); |
408 | Assert.Equal(expected, actual); | 437 | WixAssert.CompareLineByLine(expected, actual); |
409 | } | 438 | } |
410 | 439 | ||
411 | [Fact] | 440 | [Fact] |
@@ -422,7 +451,8 @@ namespace WixToolsetTest.Converters | |||
422 | "</Fragment>", | 451 | "</Fragment>", |
423 | "</Wix>"); | 452 | "</Wix>"); |
424 | 453 | ||
425 | var expected = String.Join(Environment.NewLine, | 454 | var expected = new[] |
455 | { | ||
426 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | 456 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", |
427 | "<Fragment>", | 457 | "<Fragment>", |
428 | "<ComponentGroup Id=\"!(loc.Variable)\" />", | 458 | "<ComponentGroup Id=\"!(loc.Variable)\" />", |
@@ -431,7 +461,8 @@ namespace WixToolsetTest.Converters | |||
431 | "<ComponentGroup Id=\"$$$$(loc.Variable)\" />", | 461 | "<ComponentGroup Id=\"$$$$(loc.Variable)\" />", |
432 | "<ComponentGroup Id=\"$$$$!(loc.Variable)\" />", | 462 | "<ComponentGroup Id=\"$$$$!(loc.Variable)\" />", |
433 | "</Fragment>", | 463 | "</Fragment>", |
434 | "</Wix>"); | 464 | "</Wix>", |
465 | }; | ||
435 | 466 | ||
436 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 467 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
437 | 468 | ||
@@ -440,10 +471,10 @@ namespace WixToolsetTest.Converters | |||
440 | 471 | ||
441 | var errors = converter.ConvertDocument(document); | 472 | var errors = converter.ConvertDocument(document); |
442 | 473 | ||
443 | var actual = UnformattedDocumentString(document); | 474 | var actual = UnformattedDocumentLines(document); |
444 | 475 | ||
445 | Assert.Equal(3, errors); | 476 | Assert.Equal(3, errors); |
446 | Assert.Equal(expected, actual); | 477 | WixAssert.CompareLineByLine(expected, actual); |
447 | } | 478 | } |
448 | } | 479 | } |
449 | } | 480 | } |
diff --git a/src/wix/test/WixToolsetTest.Converters/ConverterIntegrationFixture.cs b/src/wix/test/WixToolsetTest.Converters/ConverterIntegrationFixture.cs index a39f6243..a8908df7 100644 --- a/src/wix/test/WixToolsetTest.Converters/ConverterIntegrationFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/ConverterIntegrationFixture.cs | |||
@@ -35,7 +35,7 @@ namespace WixToolsetTest.Converters | |||
35 | 35 | ||
36 | var expected = File.ReadAllText(Path.Combine(folder, afterFileName)).Replace("\r\n", "\n"); | 36 | var expected = File.ReadAllText(Path.Combine(folder, afterFileName)).Replace("\r\n", "\n"); |
37 | var actual = File.ReadAllText(targetFile).Replace("\r\n", "\n"); | 37 | var actual = File.ReadAllText(targetFile).Replace("\r\n", "\n"); |
38 | Assert.Equal(expected, actual); | 38 | WixAssert.StringEqual(expected, actual); |
39 | 39 | ||
40 | EnsureFixed(targetFile); | 40 | EnsureFixed(targetFile); |
41 | } | 41 | } |
@@ -62,7 +62,7 @@ namespace WixToolsetTest.Converters | |||
62 | 62 | ||
63 | var expected = File.ReadAllText(Path.Combine(folder, afterFileName)).Replace("\r\n", "\n"); | 63 | var expected = File.ReadAllText(Path.Combine(folder, afterFileName)).Replace("\r\n", "\n"); |
64 | var actual = File.ReadAllText(targetFile).Replace("\r\n", "\n"); | 64 | var actual = File.ReadAllText(targetFile).Replace("\r\n", "\n"); |
65 | Assert.Equal(expected, actual); | 65 | WixAssert.StringEqual(expected, actual); |
66 | 66 | ||
67 | EnsureFixed(targetFile); | 67 | EnsureFixed(targetFile); |
68 | } | 68 | } |
@@ -111,7 +111,7 @@ namespace WixToolsetTest.Converters | |||
111 | 111 | ||
112 | var expected = File.ReadAllText(Path.Combine(folder, afterFileName)).Replace("\r\n", "\n"); | 112 | var expected = File.ReadAllText(Path.Combine(folder, afterFileName)).Replace("\r\n", "\n"); |
113 | var actual = File.ReadAllText(targetFile).Replace("\r\n", "\n"); | 113 | var actual = File.ReadAllText(targetFile).Replace("\r\n", "\n"); |
114 | Assert.Equal(expected, actual); | 114 | WixAssert.StringEqual(expected, actual); |
115 | 115 | ||
116 | EnsureFixed(targetFile); | 116 | EnsureFixed(targetFile); |
117 | } | 117 | } |
@@ -135,7 +135,7 @@ namespace WixToolsetTest.Converters | |||
135 | 135 | ||
136 | var expected = File.ReadAllText(Path.Combine(folder, afterFileName)).Replace("\r\n", "\n"); | 136 | var expected = File.ReadAllText(Path.Combine(folder, afterFileName)).Replace("\r\n", "\n"); |
137 | var actual = File.ReadAllText(targetFile).Replace("\r\n", "\n"); | 137 | var actual = File.ReadAllText(targetFile).Replace("\r\n", "\n"); |
138 | Assert.Equal(expected, actual); | 138 | WixAssert.StringEqual(expected, actual); |
139 | 139 | ||
140 | EnsureFixed(targetFile); | 140 | EnsureFixed(targetFile); |
141 | } | 141 | } |
@@ -161,7 +161,7 @@ namespace WixToolsetTest.Converters | |||
161 | 161 | ||
162 | var expected = File.ReadAllText(Path.Combine(folder, afterFileName)).Replace("\r\n", "\n"); | 162 | var expected = File.ReadAllText(Path.Combine(folder, afterFileName)).Replace("\r\n", "\n"); |
163 | var actual = File.ReadAllText(targetFile).Replace("\r\n", "\n"); | 163 | var actual = File.ReadAllText(targetFile).Replace("\r\n", "\n"); |
164 | Assert.Equal(expected, actual); | 164 | WixAssert.StringEqual(expected, actual); |
165 | 165 | ||
166 | // still fails because QtExecCmdTimeoutAmbiguous is unfixable | 166 | // still fails because QtExecCmdTimeoutAmbiguous is unfixable |
167 | var result2 = RunConversion(targetFile); | 167 | var result2 = RunConversion(targetFile); |
diff --git a/src/wix/test/WixToolsetTest.Converters/CustomActionFixture.cs b/src/wix/test/WixToolsetTest.Converters/CustomActionFixture.cs index eafc171a..7389bc35 100644 --- a/src/wix/test/WixToolsetTest.Converters/CustomActionFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/CustomActionFixture.cs | |||
@@ -5,6 +5,7 @@ namespace WixToolsetTest.Converters | |||
5 | using System; | 5 | using System; |
6 | using System.IO; | 6 | using System.IO; |
7 | using System.Xml.Linq; | 7 | using System.Xml.Linq; |
8 | using WixBuildTools.TestSupport; | ||
8 | using WixToolset.Converters; | 9 | using WixToolset.Converters; |
9 | using WixToolsetTest.Converters.Mocks; | 10 | using WixToolsetTest.Converters.Mocks; |
10 | using Xunit; | 11 | using Xunit; |
@@ -23,13 +24,15 @@ namespace WixToolsetTest.Converters | |||
23 | " <CustomAction Id='Foo' BinaryKey='UtilCA_x64' DllEntry='WixQuietExec64' />", | 24 | " <CustomAction Id='Foo' BinaryKey='UtilCA_x64' DllEntry='WixQuietExec64' />", |
24 | "</Wix>"); | 25 | "</Wix>"); |
25 | 26 | ||
26 | var expected = String.Join(Environment.NewLine, | 27 | var expected = new[] |
28 | { | ||
27 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | 29 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", |
28 | " <CustomAction Id=\"Foo\" DllEntry=\"WixQuietExec\" BinaryRef=\"Wix4UtilCA_X86\" />", | 30 | " <CustomAction Id=\"Foo\" DllEntry=\"WixQuietExec\" BinaryRef=\"Wix4UtilCA_X86\" />", |
29 | " <CustomAction Id=\"Foo\" DllEntry=\"WixQuietExec64\" BinaryRef=\"Wix4UtilCA_X64\" />", | 31 | " <CustomAction Id=\"Foo\" DllEntry=\"WixQuietExec64\" BinaryRef=\"Wix4UtilCA_X64\" />", |
30 | " <CustomAction Id=\"Foo\" DllEntry=\"WixQuietExec\" BinaryRef=\"Wix4UtilCA_X86\" />", | 32 | " <CustomAction Id=\"Foo\" DllEntry=\"WixQuietExec\" BinaryRef=\"Wix4UtilCA_X86\" />", |
31 | " <CustomAction Id=\"Foo\" DllEntry=\"WixQuietExec64\" BinaryRef=\"Wix4UtilCA_X64\" />", | 33 | " <CustomAction Id=\"Foo\" DllEntry=\"WixQuietExec64\" BinaryRef=\"Wix4UtilCA_X64\" />", |
32 | "</Wix>"); | 34 | "</Wix>", |
35 | }; | ||
33 | 36 | ||
34 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 37 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
35 | 38 | ||
@@ -38,10 +41,10 @@ namespace WixToolsetTest.Converters | |||
38 | 41 | ||
39 | var errors = converter.ConvertDocument(document); | 42 | var errors = converter.ConvertDocument(document); |
40 | 43 | ||
41 | var actual = UnformattedDocumentString(document); | 44 | var actual = UnformattedDocumentLines(document); |
42 | 45 | ||
43 | Assert.Equal(11, errors); | 46 | Assert.Equal(11, errors); |
44 | Assert.Equal(expected, actual); | 47 | WixAssert.CompareLineByLine(expected, actual); |
45 | } | 48 | } |
46 | 49 | ||
47 | [Fact] | 50 | [Fact] |
@@ -58,10 +61,12 @@ namespace WixToolsetTest.Converters | |||
58 | " </CustomAction>", | 61 | " </CustomAction>", |
59 | "</Wix>"); | 62 | "</Wix>"); |
60 | 63 | ||
61 | var expected = String.Join(Environment.NewLine, | 64 | var expected = new[] |
65 | { | ||
62 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | 66 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", |
63 | " <CustomAction Id=\"Foo\" Script=\"jscript\" ScriptSourceFile=\"Foo.js\" />", | 67 | " <CustomAction Id=\"Foo\" Script=\"jscript\" ScriptSourceFile=\"Foo.js\" />", |
64 | "</Wix>"); | 68 | "</Wix>", |
69 | }; | ||
65 | 70 | ||
66 | var expectedScript = String.Join("\n", | 71 | var expectedScript = String.Join("\n", |
67 | "function() {", | 72 | "function() {", |
@@ -76,13 +81,13 @@ namespace WixToolsetTest.Converters | |||
76 | 81 | ||
77 | var errors = converter.ConvertDocument(document); | 82 | var errors = converter.ConvertDocument(document); |
78 | 83 | ||
79 | var actual = UnformattedDocumentString(document); | 84 | var actual = UnformattedDocumentLines(document); |
80 | 85 | ||
81 | Assert.Equal(2, errors); | 86 | Assert.Equal(2, errors); |
82 | Assert.Equal(expected, actual); | 87 | WixAssert.CompareLineByLine(expected, actual); |
83 | 88 | ||
84 | var script = File.ReadAllText("Foo.js"); | 89 | var script = File.ReadAllText("Foo.js"); |
85 | Assert.Equal(expectedScript, script); | 90 | WixAssert.StringEqual(expectedScript, script); |
86 | } | 91 | } |
87 | } | 92 | } |
88 | } | 93 | } |
diff --git a/src/wix/test/WixToolsetTest.Converters/CustomTableFixture.cs b/src/wix/test/WixToolsetTest.Converters/CustomTableFixture.cs index 2b81a863..6dd3da97 100644 --- a/src/wix/test/WixToolsetTest.Converters/CustomTableFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/CustomTableFixture.cs | |||
@@ -181,7 +181,8 @@ namespace WixToolsetTest.Converters | |||
181 | " </CustomTable>", | 181 | " </CustomTable>", |
182 | "</Wix>"); | 182 | "</Wix>"); |
183 | 183 | ||
184 | var expected = String.Join(Environment.NewLine, | 184 | var expected = new[] |
185 | { | ||
185 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | 186 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", |
186 | " <BundleCustomData Id=\"FgAppx\">", | 187 | " <BundleCustomData Id=\"FgAppx\">", |
187 | " <BundleAttributeDefinition Id=\"Column1\" />", | 188 | " <BundleAttributeDefinition Id=\"Column1\" />", |
@@ -189,7 +190,8 @@ namespace WixToolsetTest.Converters | |||
189 | " <BundleAttribute Id=\"Column1\" Value=\"Row1\" />", | 190 | " <BundleAttribute Id=\"Column1\" Value=\"Row1\" />", |
190 | " </BundleElement>", | 191 | " </BundleElement>", |
191 | " </BundleCustomData>", | 192 | " </BundleCustomData>", |
192 | "</Wix>"); | 193 | "</Wix>", |
194 | }; | ||
193 | 195 | ||
194 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 196 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
195 | 197 | ||
@@ -198,10 +200,10 @@ namespace WixToolsetTest.Converters | |||
198 | 200 | ||
199 | var errors = converter.ConvertDocument(document); | 201 | var errors = converter.ConvertDocument(document); |
200 | 202 | ||
201 | var actual = UnformattedDocumentString(document); | 203 | var actual = UnformattedDocumentLines(document); |
202 | 204 | ||
203 | Assert.Equal(2, errors); | 205 | Assert.Equal(2, errors); |
204 | Assert.Equal(expected, actual); | 206 | WixAssert.CompareLineByLine(expected, actual); |
205 | } | 207 | } |
206 | 208 | ||
207 | [Fact] | 209 | [Fact] |
@@ -216,14 +218,16 @@ namespace WixToolsetTest.Converters | |||
216 | " </CustomTable>", | 218 | " </CustomTable>", |
217 | "</Wix>"); | 219 | "</Wix>"); |
218 | 220 | ||
219 | var expected = String.Join(Environment.NewLine, | 221 | var expected = new[] |
222 | { | ||
220 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | 223 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", |
221 | " <BundleCustomDataRef Id=\"FgAppx\">", | 224 | " <BundleCustomDataRef Id=\"FgAppx\">", |
222 | " <BundleElement>", | 225 | " <BundleElement>", |
223 | " <BundleAttribute Id=\"Column1\" Value=\"Row1\" />", | 226 | " <BundleAttribute Id=\"Column1\" Value=\"Row1\" />", |
224 | " </BundleElement>", | 227 | " </BundleElement>", |
225 | " </BundleCustomDataRef>", | 228 | " </BundleCustomDataRef>", |
226 | "</Wix>"); | 229 | "</Wix>", |
230 | }; | ||
227 | 231 | ||
228 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 232 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
229 | 233 | ||
@@ -232,10 +236,10 @@ namespace WixToolsetTest.Converters | |||
232 | 236 | ||
233 | var errors = converter.ConvertDocument(document); | 237 | var errors = converter.ConvertDocument(document); |
234 | 238 | ||
235 | var actual = UnformattedDocumentString(document); | 239 | var actual = UnformattedDocumentLines(document); |
236 | 240 | ||
237 | Assert.Equal(2, errors); | 241 | Assert.Equal(2, errors); |
238 | Assert.Equal(expected, actual); | 242 | WixAssert.CompareLineByLine(expected, actual); |
239 | } | 243 | } |
240 | 244 | ||
241 | [Fact] | 245 | [Fact] |
@@ -251,7 +255,8 @@ namespace WixToolsetTest.Converters | |||
251 | " </CustomTable>", | 255 | " </CustomTable>", |
252 | "</Wix>"); | 256 | "</Wix>"); |
253 | 257 | ||
254 | var expected = String.Join(Environment.NewLine, | 258 | var expected = new[] |
259 | { | ||
255 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | 260 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", |
256 | " <CustomTable Id=\"FgAppx\" Unreal=\"yes\">", | 261 | " <CustomTable Id=\"FgAppx\" Unreal=\"yes\">", |
257 | " <Column Id=\"Column1\" PrimaryKey=\"yes\" Type=\"string\" Width=\"0\" Category=\"text\" Description=\"The first custom column.\" />", | 262 | " <Column Id=\"Column1\" PrimaryKey=\"yes\" Type=\"string\" Width=\"0\" Category=\"text\" Description=\"The first custom column.\" />", |
@@ -259,7 +264,8 @@ namespace WixToolsetTest.Converters | |||
259 | " <Data Column=\"Column1\" Value=\"Row1\" />", | 264 | " <Data Column=\"Column1\" Value=\"Row1\" />", |
260 | " </Row>", | 265 | " </Row>", |
261 | " </CustomTable>", | 266 | " </CustomTable>", |
262 | "</Wix>"); | 267 | "</Wix>", |
268 | }; | ||
263 | 269 | ||
264 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 270 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
265 | 271 | ||
@@ -268,10 +274,10 @@ namespace WixToolsetTest.Converters | |||
268 | 274 | ||
269 | var errors = converter.ConvertDocument(document); | 275 | var errors = converter.ConvertDocument(document); |
270 | 276 | ||
271 | var actual = UnformattedDocumentString(document); | 277 | var actual = UnformattedDocumentLines(document); |
272 | 278 | ||
273 | Assert.Equal(2, errors); | 279 | Assert.Equal(2, errors); |
274 | Assert.Equal(expected, actual); | 280 | WixAssert.CompareLineByLine(expected, actual); |
275 | } | 281 | } |
276 | 282 | ||
277 | [Fact] | 283 | [Fact] |
@@ -286,14 +292,16 @@ namespace WixToolsetTest.Converters | |||
286 | " </CustomTable>", | 292 | " </CustomTable>", |
287 | "</Wix>"); | 293 | "</Wix>"); |
288 | 294 | ||
289 | var expected = String.Join(Environment.NewLine, | 295 | var expected = new[] |
296 | { | ||
290 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | 297 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", |
291 | " <CustomTableRef Id=\"FgAppx\">", | 298 | " <CustomTableRef Id=\"FgAppx\">", |
292 | " <Row>", | 299 | " <Row>", |
293 | " <Data Column=\"Column1\" Value=\"Row1\" />", | 300 | " <Data Column=\"Column1\" Value=\"Row1\" />", |
294 | " </Row>", | 301 | " </Row>", |
295 | " </CustomTableRef>", | 302 | " </CustomTableRef>", |
296 | "</Wix>"); | 303 | "</Wix>", |
304 | }; | ||
297 | 305 | ||
298 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 306 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
299 | 307 | ||
@@ -302,10 +310,10 @@ namespace WixToolsetTest.Converters | |||
302 | 310 | ||
303 | var errors = converter.ConvertDocument(document); | 311 | var errors = converter.ConvertDocument(document); |
304 | 312 | ||
305 | var actual = UnformattedDocumentString(document); | 313 | var actual = UnformattedDocumentLines(document); |
306 | 314 | ||
307 | Assert.Equal(2, errors); | 315 | Assert.Equal(2, errors); |
308 | Assert.Equal(expected, actual); | 316 | WixAssert.CompareLineByLine(expected, actual); |
309 | } | 317 | } |
310 | 318 | ||
311 | [Fact] | 319 | [Fact] |
@@ -316,10 +324,12 @@ namespace WixToolsetTest.Converters | |||
316 | " <CustomTable Id='FgAppx' BootstrapperApplicationData='yes' />", | 324 | " <CustomTable Id='FgAppx' BootstrapperApplicationData='yes' />", |
317 | "</Wix>"); | 325 | "</Wix>"); |
318 | 326 | ||
319 | var expected = String.Join(Environment.NewLine, | 327 | var expected = new[] |
328 | { | ||
320 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | 329 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", |
321 | " <CustomTable Id=\"FgAppx\" BootstrapperApplicationData=\"yes\" />", | 330 | " <CustomTable Id=\"FgAppx\" BootstrapperApplicationData=\"yes\" />", |
322 | "</Wix>"); | 331 | "</Wix>", |
332 | }; | ||
323 | 333 | ||
324 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 334 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
325 | 335 | ||
@@ -328,10 +338,10 @@ namespace WixToolsetTest.Converters | |||
328 | 338 | ||
329 | var errors = converter.ConvertDocument(document); | 339 | var errors = converter.ConvertDocument(document); |
330 | 340 | ||
331 | var actual = UnformattedDocumentString(document); | 341 | var actual = UnformattedDocumentLines(document); |
332 | 342 | ||
333 | Assert.Equal(1, errors); | 343 | Assert.Equal(1, errors); |
334 | Assert.Equal(expected, actual); | 344 | WixAssert.CompareLineByLine(expected, actual); |
335 | } | 345 | } |
336 | 346 | ||
337 | [Fact] | 347 | [Fact] |
@@ -342,10 +352,12 @@ namespace WixToolsetTest.Converters | |||
342 | " <CustomTable Id='FgAppx' BootstrapperApplicationData='no' />", | 352 | " <CustomTable Id='FgAppx' BootstrapperApplicationData='no' />", |
343 | "</Wix>"); | 353 | "</Wix>"); |
344 | 354 | ||
345 | var expected = String.Join(Environment.NewLine, | 355 | var expected = new[] |
356 | { | ||
346 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | 357 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", |
347 | " <CustomTable Id=\"FgAppx\" />", | 358 | " <CustomTable Id=\"FgAppx\" />", |
348 | "</Wix>"); | 359 | "</Wix>", |
360 | }; | ||
349 | 361 | ||
350 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 362 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
351 | 363 | ||
@@ -354,10 +366,10 @@ namespace WixToolsetTest.Converters | |||
354 | 366 | ||
355 | var errors = converter.ConvertDocument(document); | 367 | var errors = converter.ConvertDocument(document); |
356 | 368 | ||
357 | var actual = UnformattedDocumentString(document); | 369 | var actual = UnformattedDocumentLines(document); |
358 | 370 | ||
359 | Assert.Equal(1, errors); | 371 | Assert.Equal(1, errors); |
360 | Assert.Equal(expected, actual); | 372 | WixAssert.CompareLineByLine(expected, actual); |
361 | } | 373 | } |
362 | } | 374 | } |
363 | } | 375 | } |
diff --git a/src/wix/test/WixToolsetTest.Converters/PropertyFixture.cs b/src/wix/test/WixToolsetTest.Converters/PropertyFixture.cs index e50a6518..e9ace163 100644 --- a/src/wix/test/WixToolsetTest.Converters/PropertyFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/PropertyFixture.cs | |||
@@ -4,6 +4,7 @@ namespace WixToolsetTest.Converters | |||
4 | { | 4 | { |
5 | using System; | 5 | using System; |
6 | using System.Xml.Linq; | 6 | using System.Xml.Linq; |
7 | using WixBuildTools.TestSupport; | ||
7 | using WixToolset.Converters; | 8 | using WixToolset.Converters; |
8 | using WixToolsetTest.Converters.Mocks; | 9 | using WixToolsetTest.Converters.Mocks; |
9 | using Xunit; | 10 | using Xunit; |
@@ -22,12 +23,14 @@ namespace WixToolsetTest.Converters | |||
22 | " </Fragment>", | 23 | " </Fragment>", |
23 | "</Wix>"); | 24 | "</Wix>"); |
24 | 25 | ||
25 | var expected = String.Join(Environment.NewLine, | 26 | var expected = new[] |
27 | { | ||
26 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | 28 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", |
27 | " <Fragment>", | 29 | " <Fragment>", |
28 | " <Property Id=\"Prop\" Value=\"1<2\" />", | 30 | " <Property Id=\"Prop\" Value=\"1<2\" />", |
29 | " </Fragment>", | 31 | " </Fragment>", |
30 | "</Wix>"); | 32 | "</Wix>", |
33 | }; | ||
31 | 34 | ||
32 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 35 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
33 | 36 | ||
@@ -36,9 +39,9 @@ namespace WixToolsetTest.Converters | |||
36 | 39 | ||
37 | var errors = converter.ConvertDocument(document); | 40 | var errors = converter.ConvertDocument(document); |
38 | 41 | ||
39 | var actual = UnformattedDocumentString(document); | 42 | var actual = UnformattedDocumentLines(document); |
40 | 43 | ||
41 | Assert.Equal(expected, actual); | 44 | WixAssert.CompareLineByLine(expected, actual); |
42 | Assert.Equal(1, errors); | 45 | Assert.Equal(1, errors); |
43 | } | 46 | } |
44 | 47 | ||
@@ -56,12 +59,14 @@ namespace WixToolsetTest.Converters | |||
56 | " </Fragment>", | 59 | " </Fragment>", |
57 | "</Wix>"); | 60 | "</Wix>"); |
58 | 61 | ||
59 | var expected = String.Join(Environment.NewLine, | 62 | var expected = new[] |
63 | { | ||
60 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | 64 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", |
61 | " <Fragment>", | 65 | " <Fragment>", |
62 | " <Property Id=\"Prop\" Value=\"1<2\" />", | 66 | " <Property Id=\"Prop\" Value=\"1<2\" />", |
63 | " </Fragment>", | 67 | " </Fragment>", |
64 | "</Wix>"); | 68 | "</Wix>", |
69 | }; | ||
65 | 70 | ||
66 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 71 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
67 | 72 | ||
@@ -70,9 +75,9 @@ namespace WixToolsetTest.Converters | |||
70 | 75 | ||
71 | var errors = converter.ConvertDocument(document); | 76 | var errors = converter.ConvertDocument(document); |
72 | 77 | ||
73 | var actual = UnformattedDocumentString(document); | 78 | var actual = UnformattedDocumentLines(document); |
74 | 79 | ||
75 | Assert.Equal(expected, actual); | 80 | WixAssert.CompareLineByLine(expected, actual); |
76 | Assert.Equal(1, errors); | 81 | Assert.Equal(1, errors); |
77 | } | 82 | } |
78 | 83 | ||
@@ -86,12 +91,14 @@ namespace WixToolsetTest.Converters | |||
86 | " </Fragment>", | 91 | " </Fragment>", |
87 | "</Wix>"); | 92 | "</Wix>"); |
88 | 93 | ||
89 | var expected = String.Join(Environment.NewLine, | 94 | var expected = new[] |
95 | { | ||
90 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | 96 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", |
91 | " <Fragment>", | 97 | " <Fragment>", |
92 | " <Property Id=\"Prop\" Value=\" \" />", | 98 | " <Property Id=\"Prop\" Value=\" \" />", |
93 | " </Fragment>", | 99 | " </Fragment>", |
94 | "</Wix>"); | 100 | "</Wix>", |
101 | }; | ||
95 | 102 | ||
96 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 103 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
97 | 104 | ||
@@ -99,9 +106,9 @@ namespace WixToolsetTest.Converters | |||
99 | var converter = new WixConverter(messaging, 2, null, null); | 106 | var converter = new WixConverter(messaging, 2, null, null); |
100 | var errors = converter.ConvertDocument(document); | 107 | var errors = converter.ConvertDocument(document); |
101 | 108 | ||
102 | var actual = UnformattedDocumentString(document); | 109 | var actual = UnformattedDocumentLines(document); |
103 | 110 | ||
104 | Assert.Equal(expected, actual); | 111 | WixAssert.CompareLineByLine(expected, actual); |
105 | Assert.Equal(1, errors); | 112 | Assert.Equal(1, errors); |
106 | } | 113 | } |
107 | } | 114 | } |
diff --git a/src/wix/test/WixToolsetTest.Core.Native/CabinetFixture.cs b/src/wix/test/WixToolsetTest.Core.Native/CabinetFixture.cs index 2e43dce4..0d5d777d 100644 --- a/src/wix/test/WixToolsetTest.Core.Native/CabinetFixture.cs +++ b/src/wix/test/WixToolsetTest.Core.Native/CabinetFixture.cs | |||
@@ -5,8 +5,8 @@ namespace WixToolsetTest.CoreNative | |||
5 | using System.IO; | 5 | using System.IO; |
6 | using System.Linq; | 6 | using System.Linq; |
7 | using WixToolset.Core.Native; | 7 | using WixToolset.Core.Native; |
8 | using WixToolsetTest.CoreNative.Utility; | ||
9 | using WixToolset.Data; | 8 | using WixToolset.Data; |
9 | using WixToolsetTest.CoreNative.Utility; | ||
10 | using Xunit; | 10 | using Xunit; |
11 | 11 | ||
12 | public class CabinetFixture | 12 | public class CabinetFixture |
@@ -85,7 +85,7 @@ namespace WixToolsetTest.CoreNative | |||
85 | var cabFileInfo = enumerated[i]; | 85 | var cabFileInfo = enumerated[i]; |
86 | var fileInfo = new FileInfo(files[i]); | 86 | var fileInfo = new FileInfo(files[i]); |
87 | 87 | ||
88 | Assert.Equal(cabFileInfo.FileId, fileInfo.Name); | 88 | WixBuildTools.TestSupport.WixAssert.StringEqual(cabFileInfo.FileId, fileInfo.Name); |
89 | Assert.Equal(cabFileInfo.Size, fileInfo.Length); | 89 | Assert.Equal(cabFileInfo.Size, fileInfo.Length); |
90 | Assert.True(cabFileInfo.SameAsDateTime(fileInfo.CreationTime)); | 90 | Assert.True(cabFileInfo.SameAsDateTime(fileInfo.CreationTime)); |
91 | } | 91 | } |
diff --git a/src/wix/test/WixToolsetTest.Core.Native/CertificateHashesFixture.cs b/src/wix/test/WixToolsetTest.Core.Native/CertificateHashesFixture.cs index 5783445b..beb5224c 100644 --- a/src/wix/test/WixToolsetTest.Core.Native/CertificateHashesFixture.cs +++ b/src/wix/test/WixToolsetTest.Core.Native/CertificateHashesFixture.cs | |||
@@ -2,7 +2,6 @@ | |||
2 | 2 | ||
3 | namespace WixToolsetTest.CoreNative | 3 | namespace WixToolsetTest.CoreNative |
4 | { | 4 | { |
5 | using System.ComponentModel; | ||
6 | using System.Linq; | 5 | using System.Linq; |
7 | using WixToolset.Core.Native; | 6 | using WixToolset.Core.Native; |
8 | using WixToolsetTest.CoreNative.Utility; | 7 | using WixToolsetTest.CoreNative.Utility; |
@@ -18,9 +17,9 @@ namespace WixToolsetTest.CoreNative | |||
18 | var hashes = CertificateHashes.Read(new[] { cabFile }); | 17 | var hashes = CertificateHashes.Read(new[] { cabFile }); |
19 | 18 | ||
20 | var hash = hashes.Single(); | 19 | var hash = hashes.Single(); |
21 | Assert.Equal(cabFile, hash.Path); | 20 | WixBuildTools.TestSupport.WixAssert.StringEqual(cabFile, hash.Path); |
22 | Assert.Equal("7EC90B3FC3D580EB571210011F1095E149DCC6BB", hash.PublicKey); | 21 | WixBuildTools.TestSupport.WixAssert.StringEqual("7EC90B3FC3D580EB571210011F1095E149DCC6BB", hash.PublicKey); |
23 | Assert.Equal("0B13494DB50BC185A34389BBBAA01EDD1CF56350", hash.Thumbprint); | 22 | WixBuildTools.TestSupport.WixAssert.StringEqual("0B13494DB50BC185A34389BBBAA01EDD1CF56350", hash.Thumbprint); |
24 | Assert.Null(hash.Exception); | 23 | Assert.Null(hash.Exception); |
25 | } | 24 | } |
26 | 25 | ||
@@ -32,7 +31,7 @@ namespace WixToolsetTest.CoreNative | |||
32 | var hashes = CertificateHashes.Read(new[] { txtFile }); | 31 | var hashes = CertificateHashes.Read(new[] { txtFile }); |
33 | 32 | ||
34 | var hash = hashes.Single(); | 33 | var hash = hashes.Single(); |
35 | Assert.Equal(txtFile, hash.Path); | 34 | WixBuildTools.TestSupport.WixAssert.StringEqual(txtFile, hash.Path); |
36 | Assert.Null(hash.Exception); | 35 | Assert.Null(hash.Exception); |
37 | } | 36 | } |
38 | 37 | ||
@@ -44,9 +43,9 @@ namespace WixToolsetTest.CoreNative | |||
44 | 43 | ||
45 | var hashes = CertificateHashes.Read(new[] { cabFile, txtFile }); | 44 | var hashes = CertificateHashes.Read(new[] { cabFile, txtFile }); |
46 | 45 | ||
47 | Assert.Equal(cabFile, hashes[0].Path); | 46 | WixBuildTools.TestSupport.WixAssert.StringEqual(cabFile, hashes[0].Path); |
48 | Assert.Equal("7EC90B3FC3D580EB571210011F1095E149DCC6BB", hashes[0].PublicKey); | 47 | WixBuildTools.TestSupport.WixAssert.StringEqual("7EC90B3FC3D580EB571210011F1095E149DCC6BB", hashes[0].PublicKey); |
49 | Assert.Equal("0B13494DB50BC185A34389BBBAA01EDD1CF56350", hashes[0].Thumbprint); | 48 | WixBuildTools.TestSupport.WixAssert.StringEqual("0B13494DB50BC185A34389BBBAA01EDD1CF56350", hashes[0].Thumbprint); |
50 | Assert.Null(hashes[0].Exception); | 49 | Assert.Null(hashes[0].Exception); |
51 | 50 | ||
52 | Assert.Equal(txtFile, hashes[1].Path); | 51 | Assert.Equal(txtFile, hashes[1].Path); |
diff --git a/src/wix/test/WixToolsetTest.Core.Native/WixToolsetTest.Core.Native.csproj b/src/wix/test/WixToolsetTest.Core.Native/WixToolsetTest.Core.Native.csproj index 66273be7..e3ad52df 100644 --- a/src/wix/test/WixToolsetTest.Core.Native/WixToolsetTest.Core.Native.csproj +++ b/src/wix/test/WixToolsetTest.Core.Native/WixToolsetTest.Core.Native.csproj | |||
@@ -19,6 +19,10 @@ | |||
19 | </ItemGroup> | 19 | </ItemGroup> |
20 | 20 | ||
21 | <ItemGroup> | 21 | <ItemGroup> |
22 | <PackageReference Include="WixBuildTools.TestSupport" /> | ||
23 | </ItemGroup> | ||
24 | |||
25 | <ItemGroup> | ||
22 | <PackageReference Include="Microsoft.NET.Test.Sdk" /> | 26 | <PackageReference Include="Microsoft.NET.Test.Sdk" /> |
23 | <PackageReference Include="xunit" /> | 27 | <PackageReference Include="xunit" /> |
24 | <PackageReference Include="xunit.runner.visualstudio" PrivateAssets="All" /> | 28 | <PackageReference Include="xunit.runner.visualstudio" PrivateAssets="All" /> |
diff --git a/src/wix/test/WixToolsetTest.Core/ParserHelperFixture.cs b/src/wix/test/WixToolsetTest.Core/ParserHelperFixture.cs index 95433ab3..336e6e21 100644 --- a/src/wix/test/WixToolsetTest.Core/ParserHelperFixture.cs +++ b/src/wix/test/WixToolsetTest.Core/ParserHelperFixture.cs | |||
@@ -4,6 +4,7 @@ namespace WixToolsetTest.Core | |||
4 | { | 4 | { |
5 | using System; | 5 | using System; |
6 | using System.Xml.Linq; | 6 | using System.Xml.Linq; |
7 | using WixBuildTools.TestSupport; | ||
7 | using WixToolset.Core; | 8 | using WixToolset.Core; |
8 | using WixToolset.Data; | 9 | using WixToolset.Data; |
9 | using WixToolset.Extensibility.Services; | 10 | using WixToolset.Extensibility.Services; |
@@ -19,7 +20,7 @@ namespace WixToolsetTest.Core | |||
19 | var attribute = CreateAttribute("1.2.3.4"); | 20 | var attribute = CreateAttribute("1.2.3.4"); |
20 | var result = helper.GetAttributeVersionValue(null, attribute); | 21 | var result = helper.GetAttributeVersionValue(null, attribute); |
21 | 22 | ||
22 | Assert.Equal("1.2.3.4", result); | 23 | WixAssert.StringEqual("1.2.3.4", result); |
23 | } | 24 | } |
24 | 25 | ||
25 | [Fact] | 26 | [Fact] |
@@ -29,7 +30,7 @@ namespace WixToolsetTest.Core | |||
29 | 30 | ||
30 | var attribute = CreateAttribute("1.2.3.4.5"); | 31 | var attribute = CreateAttribute("1.2.3.4.5"); |
31 | var exception = Assert.Throws<WixException>(() => { helper.GetAttributeVersionValue(null, attribute); }); | 32 | var exception = Assert.Throws<WixException>(() => { helper.GetAttributeVersionValue(null, attribute); }); |
32 | Assert.Equal("The Test/@Value attribute's value, '1.2.3.4.5', is not a valid version. Specify a four-part version or semantic version, such as '#.#.#.#' or '#.#.#-label.#'.", exception.Message); | 33 | WixAssert.StringEqual("The Test/@Value attribute's value, '1.2.3.4.5', is not a valid version. Specify a four-part version or semantic version, such as '#.#.#.#' or '#.#.#-label.#'.", exception.Message); |
33 | } | 34 | } |
34 | 35 | ||
35 | [Fact] | 36 | [Fact] |
@@ -44,7 +45,7 @@ namespace WixToolsetTest.Core | |||
44 | var helper = GetParserHelper(); | 45 | var helper = GetParserHelper(); |
45 | var attribute = CreateAttribute(version); | 46 | var attribute = CreateAttribute(version); |
46 | var exception = Assert.Throws<WixException>(() => { helper.GetAttributeVersionValue(null, attribute); }); | 47 | var exception = Assert.Throws<WixException>(() => { helper.GetAttributeVersionValue(null, attribute); }); |
47 | Assert.Equal($"The Test/@Value attribute's value, '{version}', is not a valid version. Specify a four-part version or semantic version, such as '#.#.#.#' or '#.#.#-label.#'.", exception.Message); | 48 | WixAssert.StringEqual($"The Test/@Value attribute's value, '{version}', is not a valid version. Specify a four-part version or semantic version, such as '#.#.#.#' or '#.#.#-label.#'.", exception.Message); |
48 | } | 49 | } |
49 | 50 | ||
50 | [Fact] | 51 | [Fact] |
@@ -55,7 +56,7 @@ namespace WixToolsetTest.Core | |||
55 | var attribute = CreateAttribute("10.99.444-preview.0"); | 56 | var attribute = CreateAttribute("10.99.444-preview.0"); |
56 | var result = helper.GetAttributeVersionValue(null, attribute); | 57 | var result = helper.GetAttributeVersionValue(null, attribute); |
57 | 58 | ||
58 | Assert.Equal("10.99.444-preview.0", result); | 59 | WixAssert.StringEqual("10.99.444-preview.0", result); |
59 | } | 60 | } |
60 | 61 | ||
61 | [Fact] | 62 | [Fact] |
@@ -66,7 +67,7 @@ namespace WixToolsetTest.Core | |||
66 | var attribute = CreateAttribute("1.2.3.4-meta.123-other.456"); | 67 | var attribute = CreateAttribute("1.2.3.4-meta.123-other.456"); |
67 | var result = helper.GetAttributeVersionValue(null, attribute); | 68 | var result = helper.GetAttributeVersionValue(null, attribute); |
68 | 69 | ||
69 | Assert.Equal("1.2.3.4-meta.123-other.456", result); | 70 | WixAssert.StringEqual("1.2.3.4-meta.123-other.456", result); |
70 | } | 71 | } |
71 | 72 | ||
72 | [Fact] | 73 | [Fact] |
@@ -77,7 +78,7 @@ namespace WixToolsetTest.Core | |||
77 | var attribute = CreateAttribute("v1.2.3.4"); | 78 | var attribute = CreateAttribute("v1.2.3.4"); |
78 | var result = helper.GetAttributeVersionValue(null, attribute); | 79 | var result = helper.GetAttributeVersionValue(null, attribute); |
79 | 80 | ||
80 | Assert.Equal("1.2.3.4", result); | 81 | WixAssert.StringEqual("1.2.3.4", result); |
81 | } | 82 | } |
82 | 83 | ||
83 | 84 | ||
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/BindVariablesFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/BindVariablesFixture.cs index 820f1707..e7752a2a 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/BindVariablesFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/BindVariablesFixture.cs | |||
@@ -64,11 +64,11 @@ namespace WixToolsetTest.CoreIntegration | |||
64 | result.AssertSuccess(); | 64 | result.AssertSuccess(); |
65 | 65 | ||
66 | var queryResults = Query.QueryDatabase(msiPath, new[] { "Property" }).ToDictionary(s => s.Split('\t')[0]); | 66 | var queryResults = Query.QueryDatabase(msiPath, new[] { "Property" }).ToDictionary(s => s.Split('\t')[0]); |
67 | Assert.Equal("Property:ProductVersion\t3.14.1703.0", queryResults["Property:ProductVersion"]); | 67 | WixAssert.StringEqual("Property:ProductVersion\t3.14.1703.0", queryResults["Property:ProductVersion"]); |
68 | Assert.Equal("Property:TestPackageManufacturer\tExample Corporation", queryResults["Property:TestPackageManufacturer"]); | 68 | WixAssert.StringEqual("Property:TestPackageManufacturer\tExample Corporation", queryResults["Property:TestPackageManufacturer"]); |
69 | Assert.Equal("Property:TestPackageName\tPacakgeWithBindVariables", queryResults["Property:TestPackageName"]); | 69 | WixAssert.StringEqual("Property:TestPackageName\tPacakgeWithBindVariables", queryResults["Property:TestPackageName"]); |
70 | Assert.Equal("Property:TestPackageVersion\t3.14.1703.0", queryResults["Property:TestPackageVersion"]); | 70 | WixAssert.StringEqual("Property:TestPackageVersion\t3.14.1703.0", queryResults["Property:TestPackageVersion"]); |
71 | Assert.Equal("Property:TestTextVersion\tv", queryResults["Property:TestTextVersion"]); | 71 | WixAssert.StringEqual("Property:TestTextVersion\tv", queryResults["Property:TestTextVersion"]); |
72 | Assert.False(queryResults.ContainsKey("Property:TestTextLanguage")); | 72 | Assert.False(queryResults.ContainsKey("Property:TestTextLanguage")); |
73 | } | 73 | } |
74 | } | 74 | } |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/BundleFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/BundleFixture.cs index 6387a12a..bc7fe7a4 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/BundleFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/BundleFixture.cs | |||
@@ -86,44 +86,44 @@ namespace WixToolsetTest.CoreIntegration | |||
86 | var section = intermediate.Sections.Single(); | 86 | var section = intermediate.Sections.Single(); |
87 | 87 | ||
88 | var bundleSymbol = section.Symbols.OfType<WixBundleSymbol>().Single(); | 88 | var bundleSymbol = section.Symbols.OfType<WixBundleSymbol>().Single(); |
89 | Assert.Equal("1.0.0.0", bundleSymbol.Version); | 89 | WixAssert.StringEqual("1.0.0.0", bundleSymbol.Version); |
90 | 90 | ||
91 | var previousVersion = bundleSymbol.Fields[(int)WixBundleSymbolFields.Version].PreviousValue; | 91 | var previousVersion = bundleSymbol.Fields[(int)WixBundleSymbolFields.Version].PreviousValue; |
92 | Assert.Equal("!(bind.packageVersion.test.msi)", previousVersion.AsString()); | 92 | WixAssert.StringEqual("!(bind.packageVersion.test.msi)", previousVersion.AsString()); |
93 | 93 | ||
94 | var msiSymbol = section.Symbols.OfType<WixBundlePackageSymbol>().Single(); | 94 | var msiSymbol = section.Symbols.OfType<WixBundlePackageSymbol>().Single(); |
95 | Assert.Equal("test.msi", msiSymbol.Id.Id); | 95 | WixAssert.StringEqual("test.msi", msiSymbol.Id.Id); |
96 | 96 | ||
97 | var extractResult = BundleExtractor.ExtractBAContainer(null, exePath, baFolderPath, extractFolderPath); | 97 | var extractResult = BundleExtractor.ExtractBAContainer(null, exePath, baFolderPath, extractFolderPath); |
98 | extractResult.AssertSuccess(); | 98 | extractResult.AssertSuccess(); |
99 | 99 | ||
100 | var burnManifestData = wixOutput.GetData(BurnConstants.BurnManifestWixOutputStreamName); | 100 | var burnManifestData = wixOutput.GetData(BurnConstants.BurnManifestWixOutputStreamName); |
101 | var extractedBurnManifestData = File.ReadAllText(Path.Combine(baFolderPath, "manifest.xml"), Encoding.UTF8); | 101 | var extractedBurnManifestData = File.ReadAllText(Path.Combine(baFolderPath, "manifest.xml"), Encoding.UTF8); |
102 | Assert.Equal(extractedBurnManifestData, burnManifestData); | 102 | WixAssert.StringEqual(extractedBurnManifestData, burnManifestData); |
103 | 103 | ||
104 | var baManifestData = wixOutput.GetData(BurnConstants.BootstrapperApplicationDataWixOutputStreamName); | 104 | var baManifestData = wixOutput.GetData(BurnConstants.BootstrapperApplicationDataWixOutputStreamName); |
105 | var extractedBaManifestData = File.ReadAllText(Path.Combine(baFolderPath, "BootstrapperApplicationData.xml"), Encoding.UTF8); | 105 | var extractedBaManifestData = File.ReadAllText(Path.Combine(baFolderPath, "BootstrapperApplicationData.xml"), Encoding.UTF8); |
106 | Assert.Equal(extractedBaManifestData, baManifestData); | 106 | WixAssert.StringEqual(extractedBaManifestData, baManifestData); |
107 | 107 | ||
108 | var bextManifestData = wixOutput.GetData(BurnConstants.BundleExtensionDataWixOutputStreamName); | 108 | var bextManifestData = wixOutput.GetData(BurnConstants.BundleExtensionDataWixOutputStreamName); |
109 | var extractedBextManifestData = File.ReadAllText(Path.Combine(baFolderPath, "BundleExtensionData.xml"), Encoding.UTF8); | 109 | var extractedBextManifestData = File.ReadAllText(Path.Combine(baFolderPath, "BundleExtensionData.xml"), Encoding.UTF8); |
110 | Assert.Equal(extractedBextManifestData, bextManifestData); | 110 | WixAssert.StringEqual(extractedBextManifestData, bextManifestData); |
111 | 111 | ||
112 | foreach (XmlAttribute attribute in extractResult.ManifestDocument.DocumentElement.Attributes) | 112 | foreach (XmlAttribute attribute in extractResult.ManifestDocument.DocumentElement.Attributes) |
113 | { | 113 | { |
114 | switch (attribute.LocalName) | 114 | switch (attribute.LocalName) |
115 | { | 115 | { |
116 | case "EngineVersion": | 116 | case "EngineVersion": |
117 | Assert.Equal($"{ThisAssembly.Git.BaseVersion.Major}.{ThisAssembly.Git.BaseVersion.Minor}.{ThisAssembly.Git.BaseVersion.Patch}.{ThisAssembly.Git.Commits}", attribute.Value); | 117 | WixAssert.StringEqual($"{ThisAssembly.Git.BaseVersion.Major}.{ThisAssembly.Git.BaseVersion.Minor}.{ThisAssembly.Git.BaseVersion.Patch}.{ThisAssembly.Git.Commits}", attribute.Value); |
118 | break; | 118 | break; |
119 | case "ProtocolVersion": | 119 | case "ProtocolVersion": |
120 | Assert.Equal("1", attribute.Value); | 120 | WixAssert.StringEqual("1", attribute.Value); |
121 | break; | 121 | break; |
122 | case "Win64": | 122 | case "Win64": |
123 | Assert.Equal("no", attribute.Value); | 123 | WixAssert.StringEqual("no", attribute.Value); |
124 | break; | 124 | break; |
125 | case "xmlns": | 125 | case "xmlns": |
126 | Assert.Equal("http://wixtoolset.org/schemas/v4/2008/Burn", attribute.Value); | 126 | WixAssert.StringEqual("http://wixtoolset.org/schemas/v4/2008/Burn", attribute.Value); |
127 | break; | 127 | break; |
128 | default: | 128 | default: |
129 | Assert.False(true, $"Attribute: '{attribute.LocalName}', Value: '{attribute.Value}'"); | 129 | Assert.False(true, $"Attribute: '{attribute.LocalName}', Value: '{attribute.Value}'"); |
@@ -131,30 +131,38 @@ namespace WixToolsetTest.CoreIntegration | |||
131 | } | 131 | } |
132 | } | 132 | } |
133 | 133 | ||
134 | var commandLineElements = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:CommandLine"); | 134 | var commandLineElements = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:CommandLine"); |
135 | var commandLineElement = (XmlNode)Assert.Single(commandLineElements); | 135 | WixAssert.CompareLineByLine(new[] |
136 | Assert.Equal("<CommandLine Variables='upperCase' />", commandLineElement.GetTestXml()); | 136 | { |
137 | "<CommandLine Variables='upperCase' />", | ||
138 | }, commandLineElements); | ||
137 | 139 | ||
138 | var logElements = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Log"); | 140 | var logElements = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Log"); |
139 | var logElement = (XmlNode)Assert.Single(logElements); | 141 | WixAssert.CompareLineByLine(new[] |
140 | Assert.Equal("<Log PathVariable='WixBundleLog' Prefix='~TestBundle' Extension='log' />", logElement.GetTestXml()); | 142 | { |
143 | "<Log PathVariable='WixBundleLog' Prefix='~TestBundle' Extension='log' />", | ||
144 | }, logElements); | ||
141 | 145 | ||
142 | var registrationElements = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Registration"); | 146 | var registrationElements = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Registration"); |
143 | var registrationElement = (XmlNode)Assert.Single(registrationElements); | 147 | WixAssert.CompareLineByLine(new[] |
144 | Assert.Equal($"<Registration Id='{bundleSymbol.BundleId}' ExecutableName='test.exe' PerMachine='yes' Tag='' Version='1.0.0.0' ProviderKey='{bundleSymbol.BundleId}'>" + | 148 | { |
149 | $"<Registration Id='{bundleSymbol.BundleId}' ExecutableName='test.exe' PerMachine='yes' Tag='' Version='1.0.0.0' ProviderKey='{bundleSymbol.BundleId}'>" + | ||
145 | "<Arp DisplayName='~TestBundle' DisplayVersion='1.0.0.0' InProgressDisplayName='~InProgressTestBundle' Publisher='Example Corporation' />" + | 150 | "<Arp DisplayName='~TestBundle' DisplayVersion='1.0.0.0' InProgressDisplayName='~InProgressTestBundle' Publisher='Example Corporation' />" + |
146 | "</Registration>", registrationElement.GetTestXml()); | 151 | "</Registration>", |
152 | }, registrationElements); | ||
147 | 153 | ||
148 | var msiPayloads = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Payload[@Id='test.msi']"); | 154 | var ignoreAttributesByElementName = new Dictionary<string, List<string>>() { { "Payload", new List<string> { "FileSize", "Hash" } } }; |
149 | var msiPayload = (XmlNode)Assert.Single(msiPayloads); | 155 | var msiPayloads = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Payload[@Id='test.msi']", ignoreAttributesByElementName); |
150 | Assert.Equal("<Payload Id='test.msi' FilePath='test.msi' FileSize='*' Hash='*' Packaging='embedded' SourcePath='a0' Container='WixAttachedContainer' />", | 156 | WixAssert.CompareLineByLine(new[] |
151 | msiPayload.GetTestXml(new Dictionary<string, List<string>>() { { "Payload", new List<string> { "FileSize", "Hash" } } })); | 157 | { |
158 | "<Payload Id='test.msi' FilePath='test.msi' FileSize='*' Hash='*' Packaging='embedded' SourcePath='a0' Container='WixAttachedContainer' />", | ||
159 | }, msiPayloads); | ||
152 | } | 160 | } |
153 | 161 | ||
154 | var manifestResource = new Resource(ResourceType.Manifest, "#1", 1033); | 162 | var manifestResource = new Resource(ResourceType.Manifest, "#1", 1033); |
155 | manifestResource.Load(exePath); | 163 | manifestResource.Load(exePath); |
156 | var actualManifestData = Encoding.UTF8.GetString(manifestResource.Data); | 164 | var actualManifestData = Encoding.UTF8.GetString(manifestResource.Data); |
157 | Assert.Equal("<?xml version=\"1.0\" encoding=\"utf-8\"?>" + | 165 | WixAssert.StringEqual("<?xml version=\"1.0\" encoding=\"utf-8\"?>" + |
158 | "<assembly manifestVersion=\"1.0\" xmlns=\"urn:schemas-microsoft-com:asm.v1\">" + | 166 | "<assembly manifestVersion=\"1.0\" xmlns=\"urn:schemas-microsoft-com:asm.v1\">" + |
159 | "<assemblyIdentity name=\"test.exe\" version=\"1.0.0.0\" processorArchitecture=\"x86\" type=\"win32\" />" + | 167 | "<assemblyIdentity name=\"test.exe\" version=\"1.0.0.0\" processorArchitecture=\"x86\" type=\"win32\" />" + |
160 | "<description>~TestBundle</description>" + | 168 | "<description>~TestBundle</description>" + |
@@ -181,7 +189,7 @@ namespace WixToolsetTest.CoreIntegration | |||
181 | var attachedFolderPath = Path.Combine(baseFolder, "attached"); | 189 | var attachedFolderPath = Path.Combine(baseFolder, "attached"); |
182 | var extractFolderPath = Path.Combine(baseFolder, "extract"); | 190 | var extractFolderPath = Path.Combine(baseFolder, "extract"); |
183 | 191 | ||
184 | var result = WixRunner.Execute(false, new[] // TODO: go back to elevating warnings as errors. | 192 | var result = WixRunner.Execute(new[] |
185 | { | 193 | { |
186 | "build", | 194 | "build", |
187 | "-arch", "x64", | 195 | "-arch", "x64", |
@@ -200,7 +208,7 @@ namespace WixToolsetTest.CoreIntegration | |||
200 | var manifestResource = new Resource(ResourceType.Manifest, "#1", 1033); | 208 | var manifestResource = new Resource(ResourceType.Manifest, "#1", 1033); |
201 | manifestResource.Load(exePath); | 209 | manifestResource.Load(exePath); |
202 | var actualManifestData = Encoding.UTF8.GetString(manifestResource.Data); | 210 | var actualManifestData = Encoding.UTF8.GetString(manifestResource.Data); |
203 | Assert.Equal("<?xml version=\"1.0\" encoding=\"utf-8\"?>" + | 211 | WixAssert.StringEqual("<?xml version=\"1.0\" encoding=\"utf-8\"?>" + |
204 | "<assembly manifestVersion=\"1.0\" xmlns=\"urn:schemas-microsoft-com:asm.v1\">" + | 212 | "<assembly manifestVersion=\"1.0\" xmlns=\"urn:schemas-microsoft-com:asm.v1\">" + |
205 | "<assemblyIdentity name=\"test.exe\" version=\"1.0.0.0\" processorArchitecture=\"amd64\" type=\"win32\" />" + | 213 | "<assemblyIdentity name=\"test.exe\" version=\"1.0.0.0\" processorArchitecture=\"amd64\" type=\"win32\" />" + |
206 | "<description>~TestBundle</description>" + | 214 | "<description>~TestBundle</description>" + |
@@ -218,16 +226,16 @@ namespace WixToolsetTest.CoreIntegration | |||
218 | switch (attribute.LocalName) | 226 | switch (attribute.LocalName) |
219 | { | 227 | { |
220 | case "EngineVersion": | 228 | case "EngineVersion": |
221 | Assert.Equal($"{ThisAssembly.Git.BaseVersion.Major}.{ThisAssembly.Git.BaseVersion.Minor}.{ThisAssembly.Git.BaseVersion.Patch}.{ThisAssembly.Git.Commits}", attribute.Value); | 229 | WixAssert.StringEqual($"{ThisAssembly.Git.BaseVersion.Major}.{ThisAssembly.Git.BaseVersion.Minor}.{ThisAssembly.Git.BaseVersion.Patch}.{ThisAssembly.Git.Commits}", attribute.Value); |
222 | break; | 230 | break; |
223 | case "ProtocolVersion": | 231 | case "ProtocolVersion": |
224 | Assert.Equal("1", attribute.Value); | 232 | WixAssert.StringEqual("1", attribute.Value); |
225 | break; | 233 | break; |
226 | case "Win64": | 234 | case "Win64": |
227 | Assert.Equal("yes", attribute.Value); | 235 | WixAssert.StringEqual("yes", attribute.Value); |
228 | break; | 236 | break; |
229 | case "xmlns": | 237 | case "xmlns": |
230 | Assert.Equal("http://wixtoolset.org/schemas/v4/2008/Burn", attribute.Value); | 238 | WixAssert.StringEqual("http://wixtoolset.org/schemas/v4/2008/Burn", attribute.Value); |
231 | break; | 239 | break; |
232 | default: | 240 | default: |
233 | Assert.False(true, $"Attribute: '{attribute.LocalName}', Value: '{attribute.Value}'"); | 241 | Assert.False(true, $"Attribute: '{attribute.LocalName}', Value: '{attribute.Value}'"); |
@@ -433,7 +441,7 @@ namespace WixToolsetTest.CoreIntegration | |||
433 | } | 441 | } |
434 | 442 | ||
435 | [Fact] | 443 | [Fact] |
436 | public void CantBuildWithDuplicateCacheIds() | 444 | public void CannotBuildWithDuplicateCacheIds() |
437 | { | 445 | { |
438 | var folder = TestData.Get(@"TestData"); | 446 | var folder = TestData.Get(@"TestData"); |
439 | 447 | ||
@@ -459,7 +467,7 @@ namespace WixToolsetTest.CoreIntegration | |||
459 | } | 467 | } |
460 | 468 | ||
461 | [Fact] | 469 | [Fact] |
462 | public void CantBuildWithDuplicatePayloadNames() | 470 | public void CannotBuildWithDuplicatePayloadNames() |
463 | { | 471 | { |
464 | var folder = TestData.Get(@"TestData"); | 472 | var folder = TestData.Get(@"TestData"); |
465 | 473 | ||
@@ -520,7 +528,7 @@ namespace WixToolsetTest.CoreIntegration | |||
520 | } | 528 | } |
521 | 529 | ||
522 | [Fact] | 530 | [Fact] |
523 | public void CantBuildWithOrphanPayload() | 531 | public void CannotBuildWithOrphanPayload() |
524 | { | 532 | { |
525 | var folder = TestData.Get(@"TestData"); | 533 | var folder = TestData.Get(@"TestData"); |
526 | 534 | ||
@@ -547,7 +555,7 @@ namespace WixToolsetTest.CoreIntegration | |||
547 | } | 555 | } |
548 | 556 | ||
549 | [Fact] | 557 | [Fact] |
550 | public void CantBuildWithPackageInMultipleContainers() | 558 | public void CannotBuildWithPackageInMultipleContainers() |
551 | { | 559 | { |
552 | var folder = TestData.Get(@"TestData"); | 560 | var folder = TestData.Get(@"TestData"); |
553 | 561 | ||
@@ -603,7 +611,7 @@ namespace WixToolsetTest.CoreIntegration | |||
603 | } | 611 | } |
604 | 612 | ||
605 | [Fact] | 613 | [Fact] |
606 | public void CantBuildWithUnscheduledPackage() | 614 | public void CannotBuildWithUnscheduledPackage() |
607 | { | 615 | { |
608 | var folder = TestData.Get(@"TestData"); | 616 | var folder = TestData.Get(@"TestData"); |
609 | 617 | ||
@@ -629,7 +637,7 @@ namespace WixToolsetTest.CoreIntegration | |||
629 | } | 637 | } |
630 | 638 | ||
631 | [Fact] | 639 | [Fact] |
632 | public void CantBuildWithUnscheduledRollbackBoundary() | 640 | public void CannotBuildWithUnscheduledRollbackBoundary() |
633 | { | 641 | { |
634 | var folder = TestData.Get(@"TestData"); | 642 | var folder = TestData.Get(@"TestData"); |
635 | 643 | ||
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/BundleManifestFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/BundleManifestFixture.cs index 242b9303..45dc5160 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/BundleManifestFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/BundleManifestFixture.cs | |||
@@ -43,11 +43,13 @@ namespace WixToolsetTest.CoreIntegration | |||
43 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); | 43 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); |
44 | extractResult.AssertSuccess(); | 44 | extractResult.AssertSuccess(); |
45 | 45 | ||
46 | var customElements = extractResult.SelectBADataNodes("/ba:BootstrapperApplicationData/ba:BundleCustomTableBA"); | 46 | var customElements = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:BundleCustomTableBA"); |
47 | Assert.Equal(3, customElements.Count); | 47 | WixAssert.CompareLineByLine(new[] |
48 | Assert.Equal("<BundleCustomTableBA Id='one' Column2='two' />", customElements[0].GetTestXml()); | 48 | { |
49 | Assert.Equal("<BundleCustomTableBA Id='>' Column2='<' />", customElements[1].GetTestXml()); | 49 | "<BundleCustomTableBA Id='one' Column2='two' />", |
50 | Assert.Equal("<BundleCustomTableBA Id='1' Column2='2' />", customElements[2].GetTestXml()); | 50 | "<BundleCustomTableBA Id='>' Column2='<' />", |
51 | "<BundleCustomTableBA Id='1' Column2='2' />", | ||
52 | }, customElements); | ||
51 | } | 53 | } |
52 | } | 54 | } |
53 | 55 | ||
@@ -82,15 +84,17 @@ namespace WixToolsetTest.CoreIntegration | |||
82 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); | 84 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); |
83 | extractResult.AssertSuccess(); | 85 | extractResult.AssertSuccess(); |
84 | 86 | ||
85 | var packageElements = extractResult.SelectBADataNodes("/ba:BootstrapperApplicationData/ba:WixPackageProperties"); | ||
86 | var ignoreAttributesByElementName = new Dictionary<string, List<string>> | 87 | var ignoreAttributesByElementName = new Dictionary<string, List<string>> |
87 | { | 88 | { |
88 | { "WixPackageProperties", new List<string> { "DownloadSize", "PackageSize", "InstalledSize", "Version" } }, | 89 | { "WixPackageProperties", new List<string> { "DownloadSize", "PackageSize", "InstalledSize", "Version" } }, |
89 | }; | 90 | }; |
90 | Assert.Equal(3, packageElements.Count); | 91 | var packageElements = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixPackageProperties", ignoreAttributesByElementName); |
91 | Assert.Equal("<WixPackageProperties Package='burn.exe' Vital='yes' DisplayName='Windows Installer XML Toolset' Description='WiX Toolset Bootstrapper' DownloadSize='*' PackageSize='*' InstalledSize='*' PackageType='Exe' Permanent='yes' LogPathVariable='WixBundleLog_burn.exe' RollbackLogPathVariable='WixBundleRollbackLog_burn.exe' Compressed='yes' Version='*' RepairCondition='RepairRedists' Cache='keep' />", packageElements[0].GetTestXml(ignoreAttributesByElementName)); | 92 | WixAssert.CompareLineByLine(new[] |
92 | Assert.Equal("<WixPackageProperties Package='RemotePayloadExe' Vital='yes' DisplayName='Override RemotePayload display name' Description='Override RemotePayload description' DownloadSize='1' PackageSize='1' InstalledSize='1' PackageType='Exe' Permanent='yes' LogPathVariable='WixBundleLog_RemotePayloadExe' RollbackLogPathVariable='WixBundleRollbackLog_RemotePayloadExe' Compressed='no' Version='1.0.0.0' Cache='keep' />", packageElements[1].GetTestXml()); | 93 | { |
93 | Assert.Equal("<WixPackageProperties Package='calc.exe' Vital='yes' DisplayName='Override harvested display name' Description='Override harvested description' DownloadSize='*' PackageSize='*' InstalledSize='*' PackageType='Exe' Permanent='yes' LogPathVariable='WixBundleLog_calc.exe' RollbackLogPathVariable='WixBundleRollbackLog_calc.exe' Compressed='yes' Version='*' Cache='keep' />", packageElements[2].GetTestXml(ignoreAttributesByElementName)); | 94 | "<WixPackageProperties Package='burn.exe' Vital='yes' DisplayName='Windows Installer XML Toolset' Description='WiX Toolset Bootstrapper' DownloadSize='*' PackageSize='*' InstalledSize='*' PackageType='Exe' Permanent='yes' LogPathVariable='WixBundleLog_burn.exe' RollbackLogPathVariable='WixBundleRollbackLog_burn.exe' Compressed='yes' Version='*' RepairCondition='RepairRedists' Cache='keep' />", |
95 | "<WixPackageProperties Package='RemotePayloadExe' Vital='yes' DisplayName='Override RemotePayload display name' Description='Override RemotePayload description' DownloadSize='*' PackageSize='*' InstalledSize='*' PackageType='Exe' Permanent='yes' LogPathVariable='WixBundleLog_RemotePayloadExe' RollbackLogPathVariable='WixBundleRollbackLog_RemotePayloadExe' Compressed='no' Version='*' Cache='keep' />", | ||
96 | "<WixPackageProperties Package='calc.exe' Vital='yes' DisplayName='Override harvested display name' Description='Override harvested description' DownloadSize='*' PackageSize='*' InstalledSize='*' PackageType='Exe' Permanent='yes' LogPathVariable='WixBundleLog_calc.exe' RollbackLogPathVariable='WixBundleRollbackLog_calc.exe' Compressed='yes' Version='*' Cache='keep' />", | ||
97 | }, packageElements); | ||
94 | } | 98 | } |
95 | } | 99 | } |
96 | 100 | ||
@@ -125,16 +129,18 @@ namespace WixToolsetTest.CoreIntegration | |||
125 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); | 129 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); |
126 | extractResult.AssertSuccess(); | 130 | extractResult.AssertSuccess(); |
127 | 131 | ||
128 | var payloadElements = extractResult.SelectBADataNodes("/ba:BootstrapperApplicationData/ba:WixPayloadProperties"); | ||
129 | var ignoreAttributesByElementName = new Dictionary<string, List<string>> | 132 | var ignoreAttributesByElementName = new Dictionary<string, List<string>> |
130 | { | 133 | { |
131 | { "WixPayloadProperties", new List<string> { "Size" } }, | 134 | { "WixPayloadProperties", new List<string> { "Size" } }, |
132 | }; | 135 | }; |
133 | Assert.Equal(4, payloadElements.Count); | 136 | var payloadElements = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixPayloadProperties", ignoreAttributesByElementName); |
134 | Assert.Equal("<WixPayloadProperties Package='credwiz.exe' Payload='SourceFilePayload' Container='WixAttachedContainer' Name='SharedPayloadsBetweenPackages.wxs' Size='*' />", payloadElements[0].GetTestXml(ignoreAttributesByElementName)); | 137 | WixAssert.CompareLineByLine(new[] |
135 | Assert.Equal("<WixPayloadProperties Package='credwiz.exe' Payload='credwiz.exe' Container='WixAttachedContainer' Name='credwiz.exe' Size='*' />", payloadElements[1].GetTestXml(ignoreAttributesByElementName)); | 138 | { |
136 | Assert.Equal("<WixPayloadProperties Package='cscript.exe' Payload='SourceFilePayload' Container='WixAttachedContainer' Name='SharedPayloadsBetweenPackages.wxs' Size='*' />", payloadElements[2].GetTestXml(ignoreAttributesByElementName)); | 139 | "<WixPayloadProperties Package='credwiz.exe' Payload='SourceFilePayload' Container='WixAttachedContainer' Name='SharedPayloadsBetweenPackages.wxs' Size='*' />", |
137 | Assert.Equal("<WixPayloadProperties Package='cscript.exe' Payload='cscript.exe' Container='WixAttachedContainer' Name='cscript.exe' Size='*' />", payloadElements[3].GetTestXml(ignoreAttributesByElementName)); | 140 | "<WixPayloadProperties Package='credwiz.exe' Payload='credwiz.exe' Container='WixAttachedContainer' Name='credwiz.exe' Size='*' />", |
141 | "<WixPayloadProperties Package='cscript.exe' Payload='SourceFilePayload' Container='WixAttachedContainer' Name='SharedPayloadsBetweenPackages.wxs' Size='*' />", | ||
142 | "<WixPayloadProperties Package='cscript.exe' Payload='cscript.exe' Container='WixAttachedContainer' Name='cscript.exe' Size='*' />", | ||
143 | }, payloadElements); | ||
138 | } | 144 | } |
139 | } | 145 | } |
140 | 146 | ||
@@ -167,17 +173,21 @@ namespace WixToolsetTest.CoreIntegration | |||
167 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); | 173 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); |
168 | extractResult.AssertSuccess(); | 174 | extractResult.AssertSuccess(); |
169 | 175 | ||
170 | var manifestRelatedBundlesElements = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:RelatedBundle"); | 176 | var manifestRelatedBundlesElements = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:RelatedBundle"); |
171 | Assert.Equal("<RelatedBundle Id='{6D4CE32B-FB91-45DA-A9B5-7E0D9929A3C3}' Action='Upgrade' />", manifestRelatedBundlesElements[0].GetTestXml()); | 177 | WixAssert.CompareLineByLine(new[] |
172 | Assert.Equal(1, manifestRelatedBundlesElements.Count); | 178 | { |
179 | "<RelatedBundle Id='{6D4CE32B-FB91-45DA-A9B5-7E0D9929A3C3}' Action='Upgrade' />", | ||
180 | }, manifestRelatedBundlesElements); | ||
173 | 181 | ||
174 | var dataRelatedBundlesElements = extractResult.SelectBADataNodes("/ba:BootstrapperApplicationData/ba:WixBundleProperties"); | ||
175 | var ignoreAttributesByElementName = new Dictionary<string, List<string>> | 182 | var ignoreAttributesByElementName = new Dictionary<string, List<string>> |
176 | { | 183 | { |
177 | { "WixBundleProperties", new List<string> { "DisplayName", "Id" } }, | 184 | { "WixBundleProperties", new List<string> { "DisplayName", "Id" } }, |
178 | }; | 185 | }; |
179 | Assert.Equal("<WixBundleProperties DisplayName='*' LogPathVariable='WixBundleLog' Compressed='no' Id='*' UpgradeCode='{6D4CE32B-FB91-45DA-A9B5-7E0D9929A3C3}' PerMachine='yes' />", dataRelatedBundlesElements[0].GetTestXml(ignoreAttributesByElementName)); | 186 | var dataRelatedBundlesElements = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixBundleProperties", ignoreAttributesByElementName); |
180 | Assert.Equal(1, dataRelatedBundlesElements.Count); | 187 | WixAssert.CompareLineByLine(new[] |
188 | { | ||
189 | "<WixBundleProperties DisplayName='*' LogPathVariable='WixBundleLog' Compressed='no' Id='*' UpgradeCode='{6D4CE32B-FB91-45DA-A9B5-7E0D9929A3C3}' PerMachine='yes' />", | ||
190 | }, dataRelatedBundlesElements); | ||
181 | } | 191 | } |
182 | } | 192 | } |
183 | 193 | ||
@@ -212,11 +222,13 @@ namespace WixToolsetTest.CoreIntegration | |||
212 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); | 222 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); |
213 | extractResult.AssertSuccess(); | 223 | extractResult.AssertSuccess(); |
214 | 224 | ||
215 | var customElements = extractResult.SelectBundleExtensionDataNodes("/be:BundleExtensionData/be:BundleExtension[@Id='CustomTableExtension']/be:BundleCustomTableBE"); | 225 | var customElements = extractResult.GetBundleExtensionTestXmlLines("/be:BundleExtensionData/be:BundleExtension[@Id='CustomTableExtension']/be:BundleCustomTableBE"); |
216 | Assert.Equal(3, customElements.Count); | 226 | WixAssert.CompareLineByLine(new[] |
217 | Assert.Equal("<BundleCustomTableBE Id='one' Column2='two' />", customElements[0].GetTestXml()); | 227 | { |
218 | Assert.Equal("<BundleCustomTableBE Id='>' Column2='<' />", customElements[1].GetTestXml()); | 228 | "<BundleCustomTableBE Id='one' Column2='two' />", |
219 | Assert.Equal("<BundleCustomTableBE Id='1' Column2='2' />", customElements[2].GetTestXml()); | 229 | "<BundleCustomTableBE Id='>' Column2='<' />", |
230 | "<BundleCustomTableBE Id='1' Column2='2' />", | ||
231 | }, customElements); | ||
220 | } | 232 | } |
221 | } | 233 | } |
222 | 234 | ||
@@ -252,13 +264,17 @@ namespace WixToolsetTest.CoreIntegration | |||
252 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); | 264 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); |
253 | extractResult.AssertSuccess(); | 265 | extractResult.AssertSuccess(); |
254 | 266 | ||
255 | var bundleExtensions = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:BundleExtension"); | 267 | var bundleExtensions = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:BundleExtension"); |
256 | Assert.Equal(1, bundleExtensions.Count); | 268 | WixAssert.CompareLineByLine(new[] |
257 | Assert.Equal("<BundleExtension Id='ExampleBext' EntryPayloadSourcePath='u1' />", bundleExtensions[0].GetTestXml()); | 269 | { |
270 | "<BundleExtension Id='ExampleBext' EntryPayloadSourcePath='u1' />", | ||
271 | }, bundleExtensions); | ||
258 | 272 | ||
259 | var bundleExtensionPayloads = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:UX/burn:Payload[@Id='ExampleBext']"); | 273 | var bundleExtensionPayloads = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:UX/burn:Payload[@Id='ExampleBext']"); |
260 | Assert.Equal(1, bundleExtensionPayloads.Count); | 274 | WixAssert.CompareLineByLine(new[] |
261 | Assert.Equal("<Payload Id='ExampleBext' FilePath='fakebext.dll' SourcePath='u1' />", bundleExtensionPayloads[0].GetTestXml()); | 275 | { |
276 | "<Payload Id='ExampleBext' FilePath='fakebext.dll' SourcePath='u1' />", | ||
277 | }, bundleExtensionPayloads); | ||
262 | } | 278 | } |
263 | } | 279 | } |
264 | 280 | ||
@@ -296,24 +312,34 @@ namespace WixToolsetTest.CoreIntegration | |||
296 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); | 312 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); |
297 | extractResult.AssertSuccess(); | 313 | extractResult.AssertSuccess(); |
298 | 314 | ||
299 | var bundleExtensions = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:BundleExtension"); | 315 | var bundleExtensions = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:BundleExtension"); |
300 | Assert.Equal(1, bundleExtensions.Count); | 316 | WixAssert.CompareLineByLine(new[] |
301 | Assert.Equal("<BundleExtension Id='ExampleBundleExtension' EntryPayloadSourcePath='u1' />", bundleExtensions[0].GetTestXml()); | 317 | { |
318 | "<BundleExtension Id='ExampleBundleExtension' EntryPayloadSourcePath='u1' />", | ||
319 | }, bundleExtensions); | ||
302 | 320 | ||
303 | var extensionSearches = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:ExtensionSearch"); | 321 | var extensionSearches = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:ExtensionSearch"); |
304 | Assert.Equal(2, extensionSearches.Count); | 322 | WixAssert.CompareLineByLine(new[] |
305 | Assert.Equal("<ExtensionSearch Id='ExampleSearchBar' Variable='SearchBar' Condition='WixBundleInstalled' ExtensionId='ExampleBundleExtension' />", extensionSearches[0].GetTestXml()); | 323 | { |
306 | Assert.Equal("<ExtensionSearch Id='ExampleSearchFoo' Variable='SearchFoo' ExtensionId='ExampleBundleExtension' />", extensionSearches[1].GetTestXml()); | 324 | "<ExtensionSearch Id='ExampleSearchBar' Variable='SearchBar' Condition='WixBundleInstalled' ExtensionId='ExampleBundleExtension' />", |
325 | "<ExtensionSearch Id='ExampleSearchFoo' Variable='SearchFoo' ExtensionId='ExampleBundleExtension' />", | ||
326 | }, extensionSearches); | ||
307 | 327 | ||
308 | var bundleExtensionDatas = extractResult.SelectBundleExtensionDataNodes("/be:BundleExtensionData/be:BundleExtension[@Id='ExampleBundleExtension']"); | 328 | var bundleExtensionDatas = extractResult.GetBundleExtensionTestXmlLines("/be:BundleExtensionData/be:BundleExtension[@Id='ExampleBundleExtension']"); |
309 | Assert.Equal(1, bundleExtensionDatas.Count); | 329 | WixAssert.CompareLineByLine(new[] |
310 | Assert.Equal("<BundleExtension Id='ExampleBundleExtension'>" + | 330 | { |
331 | "<BundleExtension Id='ExampleBundleExtension'>" + | ||
311 | "<ExampleSearch Id='ExampleSearchBar' SearchFor='Bar' />" + | 332 | "<ExampleSearch Id='ExampleSearchBar' SearchFor='Bar' />" + |
312 | "<ExampleSearch Id='ExampleSearchFoo' SearchFor='Foo' />" + | 333 | "<ExampleSearch Id='ExampleSearchFoo' SearchFor='Foo' />" + |
313 | "</BundleExtension>", bundleExtensionDatas[0].GetTestXml()); | 334 | "</BundleExtension>" |
335 | }, bundleExtensionDatas); | ||
314 | 336 | ||
315 | var exampleSearches = extractResult.SelectBundleExtensionDataNodes("/be:BundleExtensionData/be:BundleExtension[@Id='ExampleBundleExtension']/be:ExampleSearch"); | 337 | var exampleSearches = extractResult.GetBundleExtensionTestXmlLines("/be:BundleExtensionData/be:BundleExtension[@Id='ExampleBundleExtension']/be:ExampleSearch"); |
316 | Assert.Equal(2, exampleSearches.Count); | 338 | WixAssert.CompareLineByLine(new[] |
339 | { | ||
340 | "<ExampleSearch Id='ExampleSearchBar' SearchFor='Bar' />", | ||
341 | "<ExampleSearch Id='ExampleSearchFoo' SearchFor='Foo' />", | ||
342 | }, exampleSearches); | ||
317 | } | 343 | } |
318 | } | 344 | } |
319 | 345 | ||
@@ -348,14 +374,16 @@ namespace WixToolsetTest.CoreIntegration | |||
348 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); | 374 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); |
349 | extractResult.AssertSuccess(); | 375 | extractResult.AssertSuccess(); |
350 | 376 | ||
351 | var exePackageElements = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Chain/burn:ExePackage"); | ||
352 | var ignoreAttributesByElementName = new Dictionary<string, List<string>> | 377 | var ignoreAttributesByElementName = new Dictionary<string, List<string>> |
353 | { | 378 | { |
354 | { "ExePackage", new List<string> { "CacheId", "InstallSize", "Size" } }, | 379 | { "ExePackage", new List<string> { "CacheId", "InstallSize", "Size" } }, |
355 | }; | 380 | }; |
356 | Assert.Equal(2, exePackageElements.Count); | 381 | var exePackageElements = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/burn:ExePackage", ignoreAttributesByElementName); |
357 | Assert.Equal("<ExePackage Id='credwiz.exe' Cache='keep' CacheId='*' InstallSize='*' Size='*' PerMachine='yes' Permanent='yes' Vital='yes' RollbackBoundaryForward='WixDefaultBoundary' LogPathVariable='WixBundleLog_credwiz.exe' RollbackLogPathVariable='WixBundleRollbackLog_credwiz.exe' InstallArguments='' RepairArguments='' Repairable='no' DetectionType='condition' DetectCondition='none' UninstallArguments='-foo' Uninstallable='yes' Protocol='burn' Bundle='yes'><PayloadRef Id='credwiz.exe' /><PayloadRef Id='SourceFilePayload' /></ExePackage>", exePackageElements[0].GetTestXml(ignoreAttributesByElementName)); | 382 | WixAssert.CompareLineByLine(new[] |
358 | Assert.Equal("<ExePackage Id='cscript.exe' Cache='keep' CacheId='*' InstallSize='*' Size='*' PerMachine='yes' Permanent='yes' Vital='yes' RollbackBoundaryBackward='WixDefaultBoundary' LogPathVariable='WixBundleLog_cscript.exe' RollbackLogPathVariable='WixBundleRollbackLog_cscript.exe' InstallArguments='' RepairArguments='' Repairable='no' DetectionType='condition' DetectCondition='none' UninstallArguments='' Uninstallable='yes' Protocol='none' Bundle='yes'><PayloadRef Id='cscript.exe' /><PayloadRef Id='SourceFilePayload' /></ExePackage>", exePackageElements[1].GetTestXml(ignoreAttributesByElementName)); | 383 | { |
384 | "<ExePackage Id='credwiz.exe' Cache='keep' CacheId='*' InstallSize='*' Size='*' PerMachine='yes' Permanent='yes' Vital='yes' RollbackBoundaryForward='WixDefaultBoundary' LogPathVariable='WixBundleLog_credwiz.exe' RollbackLogPathVariable='WixBundleRollbackLog_credwiz.exe' InstallArguments='' RepairArguments='' Repairable='no' DetectionType='condition' DetectCondition='none' UninstallArguments='-foo' Uninstallable='yes' Protocol='burn' Bundle='yes'><PayloadRef Id='credwiz.exe' /><PayloadRef Id='SourceFilePayload' /></ExePackage>", | ||
385 | "<ExePackage Id='cscript.exe' Cache='keep' CacheId='*' InstallSize='*' Size='*' PerMachine='yes' Permanent='yes' Vital='yes' RollbackBoundaryBackward='WixDefaultBoundary' LogPathVariable='WixBundleLog_cscript.exe' RollbackLogPathVariable='WixBundleRollbackLog_cscript.exe' InstallArguments='' RepairArguments='' Repairable='no' DetectionType='condition' DetectCondition='none' UninstallArguments='' Uninstallable='yes' Protocol='none' Bundle='yes'><PayloadRef Id='cscript.exe' /><PayloadRef Id='SourceFilePayload' /></ExePackage>", | ||
386 | }, exePackageElements); | ||
359 | } | 387 | } |
360 | } | 388 | } |
361 | 389 | ||
@@ -390,14 +418,16 @@ namespace WixToolsetTest.CoreIntegration | |||
390 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); | 418 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); |
391 | extractResult.AssertSuccess(); | 419 | extractResult.AssertSuccess(); |
392 | 420 | ||
393 | var setVariables = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:SetVariable"); | 421 | var setVariables = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:SetVariable"); |
394 | Assert.Equal(6, setVariables.Count); | 422 | WixAssert.CompareLineByLine(new[] |
395 | Assert.Equal("<SetVariable Id='SetCoercedNumber' Variable='CoercedNumber' Value='2' Type='numeric' />", setVariables[0].GetTestXml()); | 423 | { |
396 | Assert.Equal("<SetVariable Id='SetCoercedString' Variable='CoercedString' Value='Bar' Type='string' />", setVariables[1].GetTestXml()); | 424 | "<SetVariable Id='SetCoercedNumber' Variable='CoercedNumber' Value='2' Type='numeric' />", |
397 | Assert.Equal("<SetVariable Id='SetCoercedVersion' Variable='CoercedVersion' Value='v2.0' Type='version' />", setVariables[2].GetTestXml()); | 425 | "<SetVariable Id='SetCoercedString' Variable='CoercedString' Value='Bar' Type='string' />", |
398 | Assert.Equal("<SetVariable Id='SetNeedsFormatting' Variable='NeedsFormatting' Value='[One] [Two] [Three]' Type='string' />", setVariables[3].GetTestXml()); | 426 | "<SetVariable Id='SetCoercedVersion' Variable='CoercedVersion' Value='v2.0' Type='version' />", |
399 | Assert.Equal("<SetVariable Id='SetVersionString' Variable='VersionString' Value='v1.0' Type='string' />", setVariables[4].GetTestXml()); | 427 | "<SetVariable Id='SetNeedsFormatting' Variable='NeedsFormatting' Value='[One] [Two] [Three]' Type='string' />", |
400 | Assert.Equal("<SetVariable Id='SetUnset' Variable='Unset' Condition='VersionString = v2.0' />", setVariables[5].GetTestXml()); | 428 | "<SetVariable Id='SetVersionString' Variable='VersionString' Value='v1.0' Type='string' />", |
429 | "<SetVariable Id='SetUnset' Variable='Unset' Condition='VersionString = v2.0' />", | ||
430 | }, setVariables); | ||
401 | } | 431 | } |
402 | } | 432 | } |
403 | } | 433 | } |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/BundlePackageFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/BundlePackageFixture.cs index bf9e330c..eb1d02f2 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/BundlePackageFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/BundlePackageFixture.cs | |||
@@ -96,11 +96,8 @@ namespace WixToolsetTest.CoreIntegration | |||
96 | { | 96 | { |
97 | { "BundlePackage", new List<string> { "Size" } }, | 97 | { "BundlePackage", new List<string> { "Size" } }, |
98 | }; | 98 | }; |
99 | var bundlePackages = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Chain/burn:BundlePackage") | 99 | var bundlePackages = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/burn:BundlePackage", ignoreAttributesByElementName); |
100 | .Cast<XmlElement>() | 100 | WixAssert.CompareLineByLine(new[] |
101 | .Select(e => e.GetTestXml(ignoreAttributesByElementName)) | ||
102 | .ToArray(); | ||
103 | WixAssert.CompareLineByLine(new string[] | ||
104 | { | 101 | { |
105 | $"<BundlePackage Id='chain.exe' Cache='keep' CacheId='{chainBundleId}v1.0.0.0' InstallSize='34' Size='*' PerMachine='yes' Permanent='yes' Vital='yes' RollbackBoundaryForward='WixDefaultBoundary' RollbackBoundaryBackward='WixDefaultBoundary' LogPathVariable='WixBundleLog_chain.exe' RollbackLogPathVariable='WixBundleRollbackLog_chain.exe' BundleId='{chainBundleId}' Version='1.0.0.0' InstallArguments='' UninstallArguments='' RepairArguments='' SupportsBurnProtocol='yes' Win64='no' HideARP='yes'>" + | 102 | $"<BundlePackage Id='chain.exe' Cache='keep' CacheId='{chainBundleId}v1.0.0.0' InstallSize='34' Size='*' PerMachine='yes' Permanent='yes' Vital='yes' RollbackBoundaryForward='WixDefaultBoundary' RollbackBoundaryBackward='WixDefaultBoundary' LogPathVariable='WixBundleLog_chain.exe' RollbackLogPathVariable='WixBundleRollbackLog_chain.exe' BundleId='{chainBundleId}' Version='1.0.0.0' InstallArguments='' UninstallArguments='' RepairArguments='' SupportsBurnProtocol='yes' Win64='no' HideARP='yes'>" + |
106 | "<Provides Key='MyProviderKey,v1.0' Version='1.0.0.0' DisplayName='BurnBundle' Imported='yes' />" + | 103 | "<Provides Key='MyProviderKey,v1.0' Version='1.0.0.0' DisplayName='BurnBundle' Imported='yes' />" + |
@@ -110,11 +107,8 @@ namespace WixToolsetTest.CoreIntegration | |||
110 | "</BundlePackage>", | 107 | "</BundlePackage>", |
111 | }, bundlePackages); | 108 | }, bundlePackages); |
112 | 109 | ||
113 | var registrations = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Registration") | 110 | var registrations = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Registration"); |
114 | .Cast<XmlElement>() | 111 | WixAssert.CompareLineByLine(new[] |
115 | .Select(e => e.GetTestXml()) | ||
116 | .ToArray(); | ||
117 | WixAssert.CompareLineByLine(new string[] | ||
118 | { | 112 | { |
119 | $"<Registration Id='{parentBundleId}' ExecutableName='parent.exe' PerMachine='yes' Tag='' Version='1.0.1.0' ProviderKey='{parentBundleId}'>" + | 113 | $"<Registration Id='{parentBundleId}' ExecutableName='parent.exe' PerMachine='yes' Tag='' Version='1.0.1.0' ProviderKey='{parentBundleId}'>" + |
120 | "<Arp DisplayName='BundlePackageBundle' DisplayVersion='1.0.1.0' Publisher='Example Corporation' />" + | 114 | "<Arp DisplayName='BundlePackageBundle' DisplayVersion='1.0.1.0' Publisher='Example Corporation' />" + |
@@ -125,11 +119,8 @@ namespace WixToolsetTest.CoreIntegration | |||
125 | { | 119 | { |
126 | { "WixPackageProperties", new List<string> { "DownloadSize", "PackageSize" } }, | 120 | { "WixPackageProperties", new List<string> { "DownloadSize", "PackageSize" } }, |
127 | }; | 121 | }; |
128 | var packageElements = extractResult.SelectBADataNodes("/ba:BootstrapperApplicationData/ba:WixPackageProperties") | 122 | var packageElements = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixPackageProperties", ignoreAttributesByElementName); |
129 | .Cast<XmlElement>() | 123 | WixAssert.CompareLineByLine(new[] |
130 | .Select(e => e.GetTestXml(ignoreAttributesByElementName)) | ||
131 | .ToArray(); | ||
132 | WixAssert.CompareLineByLine(new string[] | ||
133 | { | 124 | { |
134 | "<WixPackageProperties Package='chain.exe' Vital='yes' DisplayName='BurnBundle' Description='BurnBundle' DownloadSize='*' PackageSize='*' InstalledSize='34' PackageType='Bundle' Permanent='yes' LogPathVariable='WixBundleLog_chain.exe' RollbackLogPathVariable='WixBundleRollbackLog_chain.exe' Compressed='no' Version='1.0.0.0' Cache='keep' />", | 125 | "<WixPackageProperties Package='chain.exe' Vital='yes' DisplayName='BurnBundle' Description='BurnBundle' DownloadSize='*' PackageSize='*' InstalledSize='34' PackageType='Bundle' Permanent='yes' LogPathVariable='WixBundleLog_chain.exe' RollbackLogPathVariable='WixBundleRollbackLog_chain.exe' Compressed='no' Version='1.0.0.0' Cache='keep' />", |
135 | }, packageElements); | 126 | }, packageElements); |
@@ -167,11 +158,8 @@ namespace WixToolsetTest.CoreIntegration | |||
167 | { | 158 | { |
168 | { "BundlePackage", new List<string> { "Size" } }, | 159 | { "BundlePackage", new List<string> { "Size" } }, |
169 | }; | 160 | }; |
170 | bundlePackages = grandparentExtractResult.SelectManifestNodes("/burn:BurnManifest/burn:Chain/burn:BundlePackage") | 161 | bundlePackages = grandparentExtractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/burn:BundlePackage", ignoreAttributesByElementName); |
171 | .Cast<XmlElement>() | 162 | WixAssert.CompareLineByLine(new[] |
172 | .Select(e => e.GetTestXml(ignoreAttributesByElementName)) | ||
173 | .ToArray(); | ||
174 | WixAssert.CompareLineByLine(new string[] | ||
175 | { | 163 | { |
176 | $"<BundlePackage Id='parent.exe' Cache='keep' CacheId='{parentBundleId}v1.0.1.0' InstallSize='34' Size='*' PerMachine='yes' Permanent='yes' Vital='yes' RollbackBoundaryForward='WixDefaultBoundary' RollbackBoundaryBackward='WixDefaultBoundary' LogPathVariable='WixBundleLog_parent.exe' RollbackLogPathVariable='WixBundleRollbackLog_parent.exe' BundleId='{parentBundleId}' Version='1.0.1.0' InstallArguments='' UninstallArguments='' RepairArguments='' SupportsBurnProtocol='yes' Win64='no'>" + | 164 | $"<BundlePackage Id='parent.exe' Cache='keep' CacheId='{parentBundleId}v1.0.1.0' InstallSize='34' Size='*' PerMachine='yes' Permanent='yes' Vital='yes' RollbackBoundaryForward='WixDefaultBoundary' RollbackBoundaryBackward='WixDefaultBoundary' LogPathVariable='WixBundleLog_parent.exe' RollbackLogPathVariable='WixBundleRollbackLog_parent.exe' BundleId='{parentBundleId}' Version='1.0.1.0' InstallArguments='' UninstallArguments='' RepairArguments='' SupportsBurnProtocol='yes' Win64='no'>" + |
177 | $"<Provides Key='{parentBundleId}' Version='1.0.1.0' DisplayName='BundlePackageBundle' Imported='yes' />" + | 165 | $"<Provides Key='{parentBundleId}' Version='1.0.1.0' DisplayName='BundlePackageBundle' Imported='yes' />" + |
@@ -184,21 +172,15 @@ namespace WixToolsetTest.CoreIntegration | |||
184 | { | 172 | { |
185 | { "Payload", new List<string> { "FileSize", "Hash" } }, | 173 | { "Payload", new List<string> { "FileSize", "Hash" } }, |
186 | }; | 174 | }; |
187 | var payloads = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Payload") | 175 | var payloads = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Payload", ignoreAttributesByElementName); |
188 | .Cast<XmlElement>() | 176 | WixAssert.CompareLineByLine(new[] |
189 | .Select(e => e.GetTestXml(ignoreAttributesByElementName)) | ||
190 | .ToArray(); | ||
191 | WixAssert.CompareLineByLine(new string[] | ||
192 | { | 177 | { |
193 | "<Payload Id='payP6wZpeHEAZbDUQPEKeCpQ_9bN.4' FilePath='signed_cab1.cab' FileSize='*' Hash='*' Packaging='external' SourcePath='signed_cab1.cab' />", | 178 | "<Payload Id='payP6wZpeHEAZbDUQPEKeCpQ_9bN.4' FilePath='signed_cab1.cab' FileSize='*' Hash='*' Packaging='external' SourcePath='signed_cab1.cab' />", |
194 | "<Payload Id='chain.exe' FilePath='chain.exe' FileSize='*' Hash='*' Packaging='external' SourcePath='chain.exe' />", | 179 | "<Payload Id='chain.exe' FilePath='chain.exe' FileSize='*' Hash='*' Packaging='external' SourcePath='chain.exe' />", |
195 | }, payloads); | 180 | }, payloads); |
196 | 181 | ||
197 | registrations = grandparentExtractResult.SelectManifestNodes("/burn:BurnManifest/burn:Registration") | 182 | registrations = grandparentExtractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Registration"); |
198 | .Cast<XmlElement>() | 183 | WixAssert.CompareLineByLine(new[] |
199 | .Select(e => e.GetTestXml()) | ||
200 | .ToArray(); | ||
201 | WixAssert.CompareLineByLine(new string[] | ||
202 | { | 184 | { |
203 | $"<Registration Id='{grandparentBundleId}' ExecutableName='grandparent.exe' PerMachine='yes' Tag='' Version='1.0.2.0' ProviderKey='{grandparentBundleId}'>" + | 185 | $"<Registration Id='{grandparentBundleId}' ExecutableName='grandparent.exe' PerMachine='yes' Tag='' Version='1.0.2.0' ProviderKey='{grandparentBundleId}'>" + |
204 | "<Arp DisplayName='PermanentBundlePackageBundle' DisplayVersion='1.0.2.0' Publisher='Example Corporation' />" + | 186 | "<Arp DisplayName='PermanentBundlePackageBundle' DisplayVersion='1.0.2.0' Publisher='Example Corporation' />" + |
@@ -209,11 +191,8 @@ namespace WixToolsetTest.CoreIntegration | |||
209 | { | 191 | { |
210 | { "WixPackageProperties", new List<string> { "DownloadSize", "PackageSize" } }, | 192 | { "WixPackageProperties", new List<string> { "DownloadSize", "PackageSize" } }, |
211 | }; | 193 | }; |
212 | packageElements = grandparentExtractResult.SelectBADataNodes("/ba:BootstrapperApplicationData/ba:WixPackageProperties") | 194 | packageElements = grandparentExtractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixPackageProperties", ignoreAttributesByElementName); |
213 | .Cast<XmlElement>() | 195 | WixAssert.CompareLineByLine(new[] |
214 | .Select(e => e.GetTestXml(ignoreAttributesByElementName)) | ||
215 | .ToArray(); | ||
216 | WixAssert.CompareLineByLine(new string[] | ||
217 | { | 196 | { |
218 | "<WixPackageProperties Package='parent.exe' Vital='yes' DisplayName='BundlePackageBundle' Description='BundlePackageBundle' DownloadSize='*' PackageSize='*' InstalledSize='34' PackageType='Bundle' Permanent='yes' LogPathVariable='WixBundleLog_parent.exe' RollbackLogPathVariable='WixBundleRollbackLog_parent.exe' Compressed='yes' Version='1.0.1.0' Cache='keep' />", | 197 | "<WixPackageProperties Package='parent.exe' Vital='yes' DisplayName='BundlePackageBundle' Description='BundlePackageBundle' DownloadSize='*' PackageSize='*' InstalledSize='34' PackageType='Bundle' Permanent='yes' LogPathVariable='WixBundleLog_parent.exe' RollbackLogPathVariable='WixBundleRollbackLog_parent.exe' Compressed='yes' Version='1.0.1.0' Cache='keep' />", |
219 | }, packageElements); | 198 | }, packageElements); |
@@ -268,11 +247,8 @@ namespace WixToolsetTest.CoreIntegration | |||
268 | { | 247 | { |
269 | { "BundlePackage", new List<string> { "Size" } }, | 248 | { "BundlePackage", new List<string> { "Size" } }, |
270 | }; | 249 | }; |
271 | var bundlePackages = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Chain/burn:BundlePackage") | 250 | var bundlePackages = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/burn:BundlePackage", ignoreAttributesByElementName); |
272 | .Cast<XmlElement>() | 251 | WixAssert.CompareLineByLine(new[] |
273 | .Select(e => e.GetTestXml(ignoreAttributesByElementName)) | ||
274 | .ToArray(); | ||
275 | WixAssert.CompareLineByLine(new string[] | ||
276 | { | 252 | { |
277 | $"<BundlePackage Id='chain.exe' Cache='keep' CacheId='{chainBundleId}v1.0.0-foo.55' InstallSize='34' Size='*' PerMachine='yes' Permanent='yes' Vital='yes' RollbackBoundaryForward='WixDefaultBoundary' RollbackBoundaryBackward='WixDefaultBoundary' LogPathVariable='WixBundleLog_chain.exe' RollbackLogPathVariable='WixBundleRollbackLog_chain.exe' BundleId='{chainBundleId}' Version='1.0.0-foo.55' InstallArguments='' UninstallArguments='' RepairArguments='' SupportsBurnProtocol='yes' Win64='no'>" + | 253 | $"<BundlePackage Id='chain.exe' Cache='keep' CacheId='{chainBundleId}v1.0.0-foo.55' InstallSize='34' Size='*' PerMachine='yes' Permanent='yes' Vital='yes' RollbackBoundaryForward='WixDefaultBoundary' RollbackBoundaryBackward='WixDefaultBoundary' LogPathVariable='WixBundleLog_chain.exe' RollbackLogPathVariable='WixBundleRollbackLog_chain.exe' BundleId='{chainBundleId}' Version='1.0.0-foo.55' InstallArguments='' UninstallArguments='' RepairArguments='' SupportsBurnProtocol='yes' Win64='no'>" + |
278 | "<Provides Key='MyProviderKey,v1.0' Version='1.0.0-foo.55' DisplayName='BurnBundle' Imported='yes' />" + | 254 | "<Provides Key='MyProviderKey,v1.0' Version='1.0.0-foo.55' DisplayName='BurnBundle' Imported='yes' />" + |
@@ -281,11 +257,8 @@ namespace WixToolsetTest.CoreIntegration | |||
281 | "</BundlePackage>", | 257 | "</BundlePackage>", |
282 | }, bundlePackages); | 258 | }, bundlePackages); |
283 | 259 | ||
284 | var registrations = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Registration") | 260 | var registrations = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Registration"); |
285 | .Cast<XmlElement>() | 261 | WixAssert.CompareLineByLine(new[] |
286 | .Select(e => e.GetTestXml()) | ||
287 | .ToArray(); | ||
288 | WixAssert.CompareLineByLine(new string[] | ||
289 | { | 262 | { |
290 | $"<Registration Id='{parentBundleId}' ExecutableName='parent.exe' PerMachine='yes' Tag='' Version='1.0.1.0' ProviderKey='{parentBundleId}'>" + | 263 | $"<Registration Id='{parentBundleId}' ExecutableName='parent.exe' PerMachine='yes' Tag='' Version='1.0.1.0' ProviderKey='{parentBundleId}'>" + |
291 | "<Arp DisplayName='RemoteBundlePackageBundle' DisplayVersion='1.0.1.0' Publisher='Example Corporation' />" + | 264 | "<Arp DisplayName='RemoteBundlePackageBundle' DisplayVersion='1.0.1.0' Publisher='Example Corporation' />" + |
@@ -296,11 +269,8 @@ namespace WixToolsetTest.CoreIntegration | |||
296 | { | 269 | { |
297 | { "WixPackageProperties", new List<string> { "DownloadSize", "PackageSize" } }, | 270 | { "WixPackageProperties", new List<string> { "DownloadSize", "PackageSize" } }, |
298 | }; | 271 | }; |
299 | var packageElements = extractResult.SelectBADataNodes("/ba:BootstrapperApplicationData/ba:WixPackageProperties") | 272 | var packageElements = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixPackageProperties", ignoreAttributesByElementName); |
300 | .Cast<XmlElement>() | 273 | WixAssert.CompareLineByLine(new[] |
301 | .Select(e => e.GetTestXml(ignoreAttributesByElementName)) | ||
302 | .ToArray(); | ||
303 | WixAssert.CompareLineByLine(new string[] | ||
304 | { | 274 | { |
305 | "<WixPackageProperties Package='chain.exe' Vital='yes' DisplayName='BurnBundle' Description='BurnBundleDescription' DownloadSize='*' PackageSize='*' InstalledSize='34' PackageType='Bundle' Permanent='yes' LogPathVariable='WixBundleLog_chain.exe' RollbackLogPathVariable='WixBundleRollbackLog_chain.exe' Compressed='no' Version='1.0.0-foo.55' Cache='keep' />", | 275 | "<WixPackageProperties Package='chain.exe' Vital='yes' DisplayName='BurnBundle' Description='BurnBundleDescription' DownloadSize='*' PackageSize='*' InstalledSize='34' PackageType='Bundle' Permanent='yes' LogPathVariable='WixBundleLog_chain.exe' RollbackLogPathVariable='WixBundleRollbackLog_chain.exe' Compressed='no' Version='1.0.0-foo.55' Cache='keep' />", |
306 | }, packageElements); | 276 | }, packageElements); |
@@ -364,11 +334,8 @@ namespace WixToolsetTest.CoreIntegration | |||
364 | { | 334 | { |
365 | { "BundlePackage", new List<string> { "Size" } }, | 335 | { "BundlePackage", new List<string> { "Size" } }, |
366 | }; | 336 | }; |
367 | var bundlePackages = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Chain/burn:BundlePackage") | 337 | var bundlePackages = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/burn:BundlePackage", ignoreAttributesByElementName); |
368 | .Cast<XmlElement>() | 338 | WixAssert.CompareLineByLine(new[] |
369 | .Select(e => e.GetTestXml(ignoreAttributesByElementName)) | ||
370 | .ToArray(); | ||
371 | WixAssert.CompareLineByLine(new string[] | ||
372 | { | 339 | { |
373 | $"<BundlePackage Id='v3bundle.exe' Cache='keep' CacheId='{chainBundleId}v1.0.0.0' InstallSize='1135' Size='*' PerMachine='yes' Permanent='no' Vital='yes' RollbackBoundaryForward='WixDefaultBoundary' RollbackBoundaryBackward='WixDefaultBoundary' LogPathVariable='WixBundleLog_v3bundle.exe' RollbackLogPathVariable='WixBundleRollbackLog_v3bundle.exe' RepairCondition='0' BundleId='{chainBundleId}' Version='1.0.0.0' InstallArguments='' UninstallArguments='' RepairArguments='' SupportsBurnProtocol='yes' Win64='no'>" + | 340 | $"<BundlePackage Id='v3bundle.exe' Cache='keep' CacheId='{chainBundleId}v1.0.0.0' InstallSize='1135' Size='*' PerMachine='yes' Permanent='no' Vital='yes' RollbackBoundaryForward='WixDefaultBoundary' RollbackBoundaryBackward='WixDefaultBoundary' LogPathVariable='WixBundleLog_v3bundle.exe' RollbackLogPathVariable='WixBundleRollbackLog_v3bundle.exe' RepairCondition='0' BundleId='{chainBundleId}' Version='1.0.0.0' InstallArguments='' UninstallArguments='' RepairArguments='' SupportsBurnProtocol='yes' Win64='no'>" + |
374 | "<Provides Key='{215a70db-ab35-48c7-be51-d66eaac87177}' Version='1.0.0.0' DisplayName='CustomV3Theme' Imported='yes' />" + | 341 | "<Provides Key='{215a70db-ab35-48c7-be51-d66eaac87177}' Version='1.0.0.0' DisplayName='CustomV3Theme' Imported='yes' />" + |
@@ -377,11 +344,8 @@ namespace WixToolsetTest.CoreIntegration | |||
377 | "</BundlePackage>", | 344 | "</BundlePackage>", |
378 | }, bundlePackages); | 345 | }, bundlePackages); |
379 | 346 | ||
380 | var registrations = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Registration") | 347 | var registrations = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Registration"); |
381 | .Cast<XmlElement>() | 348 | WixAssert.CompareLineByLine(new[] |
382 | .Select(e => e.GetTestXml()) | ||
383 | .ToArray(); | ||
384 | WixAssert.CompareLineByLine(new string[] | ||
385 | { | 349 | { |
386 | $"<Registration Id='{parentBundleId}' ExecutableName='parent.exe' PerMachine='yes' Tag='' Version='1.1.1.1' ProviderKey='{parentBundleId}'>" + | 350 | $"<Registration Id='{parentBundleId}' ExecutableName='parent.exe' PerMachine='yes' Tag='' Version='1.1.1.1' ProviderKey='{parentBundleId}'>" + |
387 | "<Arp DisplayName='V3BundlePackageBundle' DisplayVersion='1.1.1.1' Publisher='Example Corporation' />" + | 351 | "<Arp DisplayName='V3BundlePackageBundle' DisplayVersion='1.1.1.1' Publisher='Example Corporation' />" + |
@@ -392,11 +356,8 @@ namespace WixToolsetTest.CoreIntegration | |||
392 | { | 356 | { |
393 | { "WixPackageProperties", new List<string> { "DownloadSize", "PackageSize" } }, | 357 | { "WixPackageProperties", new List<string> { "DownloadSize", "PackageSize" } }, |
394 | }; | 358 | }; |
395 | var packageElements = extractResult.SelectBADataNodes("/ba:BootstrapperApplicationData/ba:WixPackageProperties") | 359 | var packageElements = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixPackageProperties", ignoreAttributesByElementName); |
396 | .Cast<XmlElement>() | 360 | WixAssert.CompareLineByLine(new[] |
397 | .Select(e => e.GetTestXml(ignoreAttributesByElementName)) | ||
398 | .ToArray(); | ||
399 | WixAssert.CompareLineByLine(new string[] | ||
400 | { | 361 | { |
401 | "<WixPackageProperties Package='v3bundle.exe' Vital='yes' DisplayName='CustomV3Theme' Description='CustomV3Theme' DownloadSize='*' PackageSize='*' InstalledSize='1135' PackageType='Bundle' Permanent='no' LogPathVariable='WixBundleLog_v3bundle.exe' RollbackLogPathVariable='WixBundleRollbackLog_v3bundle.exe' Compressed='yes' Version='1.0.0.0' RepairCondition='0' Cache='keep' />", | 362 | "<WixPackageProperties Package='v3bundle.exe' Vital='yes' DisplayName='CustomV3Theme' Description='CustomV3Theme' DownloadSize='*' PackageSize='*' InstalledSize='1135' PackageType='Bundle' Permanent='no' LogPathVariable='WixBundleLog_v3bundle.exe' RollbackLogPathVariable='WixBundleRollbackLog_v3bundle.exe' Compressed='yes' Version='1.0.0.0' RepairCondition='0' Cache='keep' />", |
402 | }, packageElements); | 363 | }, packageElements); |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/CabFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/CabFixture.cs index 6fae3801..da1d47df 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/CabFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/CabFixture.cs | |||
@@ -45,7 +45,7 @@ namespace WixToolsetTest.CoreIntegration | |||
45 | WixAssert.CompareLineByLine(new[] { "Notepad.exe", "test.txt" }, fileRows.Select(f => f.Name).ToArray()); | 45 | WixAssert.CompareLineByLine(new[] { "Notepad.exe", "test.txt" }, fileRows.Select(f => f.Name).ToArray()); |
46 | 46 | ||
47 | var files = Query.GetCabinetFiles(cabPath); | 47 | var files = Query.GetCabinetFiles(cabPath); |
48 | Assert.Equal(fileRows.Select(f => f.Id).ToArray(), files.Select(f => f.Name).ToArray()); | 48 | WixAssert.CompareLineByLine(fileRows.Select(f => f.Id).ToArray(), files.Select(f => f.Name).ToArray()); |
49 | } | 49 | } |
50 | } | 50 | } |
51 | 51 | ||
@@ -90,7 +90,7 @@ namespace WixToolsetTest.CoreIntegration | |||
90 | WixAssert.CompareLineByLine(new[] { "test.txt" }, fileRows.Select(f => f.Name).ToArray()); | 90 | WixAssert.CompareLineByLine(new[] { "test.txt" }, fileRows.Select(f => f.Name).ToArray()); |
91 | 91 | ||
92 | var files = Query.GetCabinetFiles(cabPath); | 92 | var files = Query.GetCabinetFiles(cabPath); |
93 | Assert.Equal(fileRows.Select(f => f.Id).ToArray(), files.Select(f => f.Name).ToArray()); | 93 | WixAssert.CompareLineByLine(fileRows.Select(f => f.Id).ToArray(), files.Select(f => f.Name).ToArray()); |
94 | } | 94 | } |
95 | } | 95 | } |
96 | 96 | ||
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/ContainerFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/ContainerFixture.cs index 0abcaffc..febc50d4 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/ContainerFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/ContainerFixture.cs | |||
@@ -50,13 +50,15 @@ namespace WixToolsetTest.CoreIntegration | |||
50 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); | 50 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); |
51 | extractResult.AssertSuccess(); | 51 | extractResult.AssertSuccess(); |
52 | 52 | ||
53 | var payloads = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Payload"); | ||
54 | Assert.Equal(4, payloads.Count); | ||
55 | var ignoreAttributes = new Dictionary<string, List<string>> { { "Payload", new List<string> { "FileSize", "Hash" } } }; | 53 | var ignoreAttributes = new Dictionary<string, List<string>> { { "Payload", new List<string> { "FileSize", "Hash" } } }; |
56 | Assert.Equal(@"<Payload Id='FirstX64' FilePath='FirstX64\FirstX64.msi' FileSize='*' Hash='*' DownloadUrl='http://example.com//FirstX64/FirstX64/FirstX64.msi' Packaging='embedded' SourcePath='a0' Container='BundlePackages' />", payloads[0].GetTestXml(ignoreAttributes)); | 54 | var payloads = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Payload", ignoreAttributes); |
57 | Assert.Equal(@"<Payload Id='FirstX86.msi' FilePath='FirstX86\FirstX86.msi' FileSize='*' Hash='*' DownloadUrl='http://example.com//FirstX86.msi/FirstX86/FirstX86.msi' Packaging='embedded' SourcePath='a1' Container='BundlePackages' />", payloads[1].GetTestXml(ignoreAttributes)); | 55 | WixAssert.CompareLineByLine(new[] |
58 | Assert.Equal(@"<Payload Id='fk1m38Cf9RZ2Bx_ipinRY6BftelU' FilePath='FirstX86\PFiles\MsiPackage\test.txt' FileSize='*' Hash='*' DownloadUrl='http://example.com/FirstX86.msi/fk1m38Cf9RZ2Bx_ipinRY6BftelU/FirstX86/PFiles/MsiPackage/test.txt' Packaging='embedded' SourcePath='a2' Container='BundlePackages' />", payloads[2].GetTestXml(ignoreAttributes)); | 56 | { |
59 | Assert.Equal(@"<Payload Id='ff2L_N_DLQ.nSUi.l8LxG14gd2V4' FilePath='FirstX64\PFiles\MsiPackage\test.txt' FileSize='*' Hash='*' DownloadUrl='http://example.com/FirstX64/ff2L_N_DLQ.nSUi.l8LxG14gd2V4/FirstX64/PFiles/MsiPackage/test.txt' Packaging='embedded' SourcePath='a3' Container='BundlePackages' />", payloads[3].GetTestXml(ignoreAttributes)); | 57 | @"<Payload Id='FirstX64' FilePath='FirstX64\FirstX64.msi' FileSize='*' Hash='*' DownloadUrl='http://example.com//FirstX64/FirstX64/FirstX64.msi' Packaging='embedded' SourcePath='a0' Container='BundlePackages' />", |
58 | @"<Payload Id='FirstX86.msi' FilePath='FirstX86\FirstX86.msi' FileSize='*' Hash='*' DownloadUrl='http://example.com//FirstX86.msi/FirstX86/FirstX86.msi' Packaging='embedded' SourcePath='a1' Container='BundlePackages' />", | ||
59 | @"<Payload Id='fk1m38Cf9RZ2Bx_ipinRY6BftelU' FilePath='FirstX86\PFiles\MsiPackage\test.txt' FileSize='*' Hash='*' DownloadUrl='http://example.com/FirstX86.msi/fk1m38Cf9RZ2Bx_ipinRY6BftelU/FirstX86/PFiles/MsiPackage/test.txt' Packaging='embedded' SourcePath='a2' Container='BundlePackages' />", | ||
60 | @"<Payload Id='ff2L_N_DLQ.nSUi.l8LxG14gd2V4' FilePath='FirstX64\PFiles\MsiPackage\test.txt' FileSize='*' Hash='*' DownloadUrl='http://example.com/FirstX64/ff2L_N_DLQ.nSUi.l8LxG14gd2V4/FirstX64/PFiles/MsiPackage/test.txt' Packaging='embedded' SourcePath='a3' Container='BundlePackages' />", | ||
61 | }, payloads); | ||
60 | } | 62 | } |
61 | } | 63 | } |
62 | 64 | ||
@@ -94,13 +96,15 @@ namespace WixToolsetTest.CoreIntegration | |||
94 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); | 96 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); |
95 | extractResult.AssertSuccess(); | 97 | extractResult.AssertSuccess(); |
96 | 98 | ||
97 | var payloads = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Payload"); | ||
98 | Assert.Equal(4, payloads.Count); | ||
99 | var ignoreAttributes = new Dictionary<string, List<string>> { { "Payload", new List<string> { "FileSize", "Hash" } } }; | 99 | var ignoreAttributes = new Dictionary<string, List<string>> { { "Payload", new List<string> { "FileSize", "Hash" } } }; |
100 | Assert.Equal(@"<Payload Id='FirstX86.msi' FilePath='FirstX86.msi' FileSize='*' Hash='*' Packaging='embedded' SourcePath='a0' Container='WixAttachedContainer' />", payloads[0].GetTestXml(ignoreAttributes)); | 100 | var payloads = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Payload", ignoreAttributes); |
101 | Assert.Equal(@"<Payload Id='FirstX64.msi' FilePath='FirstX64.msi' FileSize='*' Hash='*' Packaging='embedded' SourcePath='a1' Container='FirstX64' />", payloads[1].GetTestXml(ignoreAttributes)); | 101 | WixAssert.CompareLineByLine(new[] |
102 | Assert.Equal(@"<Payload Id='fk1m38Cf9RZ2Bx_ipinRY6BftelU' FilePath='PFiles\MsiPackage\test.txt' FileSize='*' Hash='*' Packaging='embedded' SourcePath='a2' Container='WixAttachedContainer' />", payloads[2].GetTestXml(ignoreAttributes)); | 102 | { |
103 | Assert.Equal(@"<Payload Id='fC0n41rZK8oW3JK8LzHu6AT3CjdQ' FilePath='PFiles\MsiPackage\test.txt' FileSize='*' Hash='*' Packaging='embedded' SourcePath='a3' Container='FirstX64' />", payloads[3].GetTestXml(ignoreAttributes)); | 103 | @"<Payload Id='FirstX86.msi' FilePath='FirstX86.msi' FileSize='*' Hash='*' Packaging='embedded' SourcePath='a0' Container='WixAttachedContainer' />", |
104 | @"<Payload Id='FirstX64.msi' FilePath='FirstX64.msi' FileSize='*' Hash='*' Packaging='embedded' SourcePath='a1' Container='FirstX64' />", | ||
105 | @"<Payload Id='fk1m38Cf9RZ2Bx_ipinRY6BftelU' FilePath='PFiles\MsiPackage\test.txt' FileSize='*' Hash='*' Packaging='embedded' SourcePath='a2' Container='WixAttachedContainer' />", | ||
106 | @"<Payload Id='fC0n41rZK8oW3JK8LzHu6AT3CjdQ' FilePath='PFiles\MsiPackage\test.txt' FileSize='*' Hash='*' Packaging='embedded' SourcePath='a3' Container='FirstX64' />", | ||
107 | }, payloads); | ||
104 | } | 108 | } |
105 | } | 109 | } |
106 | 110 | ||
@@ -142,11 +146,8 @@ namespace WixToolsetTest.CoreIntegration | |||
142 | { | 146 | { |
143 | { "MsiPackage", new List<string> { "CacheId", "InstallSize", "Size", "ProductCode" } }, | 147 | { "MsiPackage", new List<string> { "CacheId", "InstallSize", "Size", "ProductCode" } }, |
144 | }; | 148 | }; |
145 | var msiPackages = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Chain/burn:MsiPackage") | 149 | var msiPackages = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/burn:MsiPackage", ignoreAttributes); |
146 | .Cast<XmlElement>() | 150 | WixAssert.CompareLineByLine(new[] |
147 | .Select(e => e.GetTestXml(ignoreAttributes)) | ||
148 | .ToArray(); | ||
149 | WixAssert.CompareLineByLine(new string[] | ||
150 | { | 151 | { |
151 | "<MsiPackage Id='FirstX86.msi' Cache='keep' CacheId='*' InstallSize='*' Size='*' PerMachine='yes' Permanent='no' Vital='yes' RollbackBoundaryForward='WixDefaultBoundary' LogPathVariable='WixBundleLog_FirstX86.msi' RollbackLogPathVariable='WixBundleRollbackLog_FirstX86.msi' ProductCode='*' Language='1033' Version='1.0.0.0' UpgradeCode='{12E4699F-E774-4D05-8A01-5BDD41BBA127}'>" + | 152 | "<MsiPackage Id='FirstX86.msi' Cache='keep' CacheId='*' InstallSize='*' Size='*' PerMachine='yes' Permanent='no' Vital='yes' RollbackBoundaryForward='WixDefaultBoundary' LogPathVariable='WixBundleLog_FirstX86.msi' RollbackLogPathVariable='WixBundleRollbackLog_FirstX86.msi' ProductCode='*' Language='1033' Version='1.0.0.0' UpgradeCode='{12E4699F-E774-4D05-8A01-5BDD41BBA127}'>" + |
152 | "<MsiProperty Id='MSIFASTINSTALL' Value='1' />" + | 153 | "<MsiProperty Id='MSIFASTINSTALL' Value='1' />" + |
@@ -196,7 +197,7 @@ namespace WixToolsetTest.CoreIntegration | |||
196 | "-o", bundlePath | 197 | "-o", bundlePath |
197 | }); | 198 | }); |
198 | 199 | ||
199 | WixAssert.CompareLineByLine(new string[] | 200 | WixAssert.CompareLineByLine(new[] |
200 | { | 201 | { |
201 | "The layout-only Payload 'SharedPayload' is being added to Container 'FirstX64'. It will not be extracted during layout.", | 202 | "The layout-only Payload 'SharedPayload' is being added to Container 'FirstX64'. It will not be extracted during layout.", |
202 | }, result.Messages.Select(m => m.ToString()).ToArray()); | 203 | }, result.Messages.Select(m => m.ToString()).ToArray()); |
@@ -208,11 +209,8 @@ namespace WixToolsetTest.CoreIntegration | |||
208 | extractResult.AssertSuccess(); | 209 | extractResult.AssertSuccess(); |
209 | 210 | ||
210 | var ignoreAttributes = new Dictionary<string, List<string>> { { "Payload", new List<string> { "FileSize", "Hash" } } }; | 211 | var ignoreAttributes = new Dictionary<string, List<string>> { { "Payload", new List<string> { "FileSize", "Hash" } } }; |
211 | var payloads = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Payload[@Id='SharedPayload']") | 212 | var payloads = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Payload[@Id='SharedPayload']", ignoreAttributes); |
212 | .Cast<XmlElement>() | 213 | WixAssert.CompareLineByLine(new[] |
213 | .Select(e => e.GetTestXml(ignoreAttributes)) | ||
214 | .ToArray(); | ||
215 | WixAssert.CompareLineByLine(new string[] | ||
216 | { | 214 | { |
217 | "<Payload Id='SharedPayload' FilePath='LayoutPayloadInContainer.wxs' FileSize='*' Hash='*' LayoutOnly='yes' Packaging='embedded' SourcePath='a1' Container='FirstX64' />", | 215 | "<Payload Id='SharedPayload' FilePath='LayoutPayloadInContainer.wxs' FileSize='*' Hash='*' LayoutOnly='yes' Packaging='embedded' SourcePath='a1' Container='FirstX64' />", |
218 | }, payloads); | 216 | }, payloads); |
@@ -257,11 +255,8 @@ namespace WixToolsetTest.CoreIntegration | |||
257 | Assert.True(File.Exists(Path.Combine(attachedFolderPath, "WixAttachedContainer", "FirstX86.msi")), "Expected extracted container to contain FirstX86.msi"); | 255 | Assert.True(File.Exists(Path.Combine(attachedFolderPath, "WixAttachedContainer", "FirstX86.msi")), "Expected extracted container to contain FirstX86.msi"); |
258 | 256 | ||
259 | var ignoreAttributes = new Dictionary<string, List<string>> { { "Payload", new List<string> { "FileSize", "Hash" } } }; | 257 | var ignoreAttributes = new Dictionary<string, List<string>> { { "Payload", new List<string> { "FileSize", "Hash" } } }; |
260 | var payloads = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Payload") | 258 | var payloads = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Payload", ignoreAttributes); |
261 | .Cast<XmlElement>() | 259 | WixAssert.CompareLineByLine(new[] |
262 | .Select(e => e.GetTestXml(ignoreAttributes)) | ||
263 | .ToArray(); | ||
264 | WixAssert.CompareLineByLine(new string[] | ||
265 | { | 260 | { |
266 | "<Payload Id='FirstX86.msi' FilePath='FirstX86.msi' FileSize='*' Hash='*' Packaging='embedded' SourcePath='a0' Container='WixAttachedContainer' />", | 261 | "<Payload Id='FirstX86.msi' FilePath='FirstX86.msi' FileSize='*' Hash='*' Packaging='embedded' SourcePath='a0' Container='WixAttachedContainer' />", |
267 | "<Payload Id='FirstX64.msi' FilePath='FirstX64.msi' FileSize='*' Hash='*' Packaging='embedded' SourcePath='a1' Container='FirstX64' />", | 262 | "<Payload Id='FirstX64.msi' FilePath='FirstX64.msi' FileSize='*' Hash='*' Packaging='embedded' SourcePath='a1' Container='FirstX64' />", |
@@ -298,7 +293,7 @@ namespace WixToolsetTest.CoreIntegration | |||
298 | "-o", bundlePath | 293 | "-o", bundlePath |
299 | }); | 294 | }); |
300 | 295 | ||
301 | WixAssert.CompareLineByLine(new string[] | 296 | WixAssert.CompareLineByLine(new[] |
302 | { | 297 | { |
303 | "The Payload 'SharedPayload' can't be added to Container 'FirstX64' because it was already added to Container 'FirstX86'.", | 298 | "The Payload 'SharedPayload' can't be added to Container 'FirstX64' because it was already added to Container 'FirstX86'.", |
304 | }, result.Messages.Select(m => m.ToString()).ToArray()); | 299 | }, result.Messages.Select(m => m.ToString()).ToArray()); |
@@ -310,11 +305,8 @@ namespace WixToolsetTest.CoreIntegration | |||
310 | extractResult.AssertSuccess(); | 305 | extractResult.AssertSuccess(); |
311 | 306 | ||
312 | var ignoreAttributes = new Dictionary<string, List<string>> { { "Payload", new List<string> { "FileSize", "Hash" } } }; | 307 | var ignoreAttributes = new Dictionary<string, List<string>> { { "Payload", new List<string> { "FileSize", "Hash" } } }; |
313 | var payloads = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Payload[@Id='SharedPayload']") | 308 | var payloads = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Payload[@Id='SharedPayload']", ignoreAttributes); |
314 | .Cast<XmlElement>() | 309 | WixAssert.CompareLineByLine(new[] |
315 | .Select(e => e.GetTestXml(ignoreAttributes)) | ||
316 | .ToArray(); | ||
317 | WixAssert.CompareLineByLine(new string[] | ||
318 | { | 310 | { |
319 | "<Payload Id='SharedPayload' FilePath='PayloadInMultipleContainers.wxs' FileSize='*' Hash='*' Packaging='embedded' SourcePath='a2' Container='FirstX86' />", | 311 | "<Payload Id='SharedPayload' FilePath='PayloadInMultipleContainers.wxs' FileSize='*' Hash='*' Packaging='embedded' SourcePath='a2' Container='FirstX86' />", |
320 | }, payloads); | 312 | }, payloads); |
@@ -347,7 +339,7 @@ namespace WixToolsetTest.CoreIntegration | |||
347 | "-o", bundlePath | 339 | "-o", bundlePath |
348 | }); | 340 | }); |
349 | 341 | ||
350 | WixAssert.CompareLineByLine(new string[] | 342 | WixAssert.CompareLineByLine(new[] |
351 | { | 343 | { |
352 | "The layout-only Payload 'SharedPayload' is being added to Container 'FirstX64'. It will not be extracted during layout.", | 344 | "The layout-only Payload 'SharedPayload' is being added to Container 'FirstX64'. It will not be extracted during layout.", |
353 | }, result.Messages.Select(m => m.ToString()).ToArray()); | 345 | }, result.Messages.Select(m => m.ToString()).ToArray()); |
@@ -362,11 +354,8 @@ namespace WixToolsetTest.CoreIntegration | |||
362 | { | 354 | { |
363 | { "WixPayloadProperties", new List<string> { "Size" } }, | 355 | { "WixPayloadProperties", new List<string> { "Size" } }, |
364 | }; | 356 | }; |
365 | var payloads = extractResult.SelectBADataNodes("/ba:BootstrapperApplicationData/ba:WixPayloadProperties") | 357 | var payloads = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixPayloadProperties", ignoreAttributesByElementName); |
366 | .Cast<XmlElement>() | 358 | WixAssert.CompareLineByLine(new[] |
367 | .Select(e => e.GetTestXml(ignoreAttributesByElementName)) | ||
368 | .ToArray(); | ||
369 | WixAssert.CompareLineByLine(new string[] | ||
370 | { | 359 | { |
371 | "<WixPayloadProperties Package='FirstX64.msi' Payload='FirstX64.msi' Container='FirstX64' Name='FirstX64.msi' Size='*' />", | 360 | "<WixPayloadProperties Package='FirstX64.msi' Payload='FirstX64.msi' Container='FirstX64' Name='FirstX64.msi' Size='*' />", |
372 | "<WixPayloadProperties Package='FirstX64.msi' Payload='SharedPayload' Container='FirstX64' Name='LayoutPayloadInContainer.wxs' Size='*' />", | 361 | "<WixPayloadProperties Package='FirstX64.msi' Payload='SharedPayload' Container='FirstX64' Name='LayoutPayloadInContainer.wxs' Size='*' />", |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/CopyFileFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/CopyFileFixture.cs index c6fa602b..a7b4a96a 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/CopyFileFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/CopyFileFixture.cs | |||
@@ -39,9 +39,9 @@ namespace WixToolsetTest.CoreIntegration | |||
39 | var intermediate = Intermediate.Load(Path.Combine(baseFolder, @"bin\test.wixpdb")); | 39 | var intermediate = Intermediate.Load(Path.Combine(baseFolder, @"bin\test.wixpdb")); |
40 | var section = intermediate.Sections.Single(); | 40 | var section = intermediate.Sections.Single(); |
41 | var copyFileSymbol = section.Symbols.OfType<MoveFileSymbol>().Single(); | 41 | var copyFileSymbol = section.Symbols.OfType<MoveFileSymbol>().Single(); |
42 | Assert.Equal("MoveText", copyFileSymbol.Id.Id); | 42 | WixAssert.StringEqual("MoveText", copyFileSymbol.Id.Id); |
43 | Assert.True(copyFileSymbol.Delete); | 43 | Assert.True(copyFileSymbol.Delete); |
44 | Assert.Equal("OtherFolder", copyFileSymbol.DestFolder); | 44 | WixAssert.StringEqual("OtherFolder", copyFileSymbol.DestFolder); |
45 | } | 45 | } |
46 | } | 46 | } |
47 | } | 47 | } |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/CustomActionFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/CustomActionFixture.cs index 7a915eb8..ef12a91e 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/CustomActionFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/CustomActionFixture.cs | |||
@@ -33,7 +33,7 @@ namespace WixToolsetTest.CoreIntegration | |||
33 | }); | 33 | }); |
34 | 34 | ||
35 | Assert.Equal(176, result.ExitCode); | 35 | Assert.Equal(176, result.ExitCode); |
36 | Assert.Equal("The InstallExecuteSequence table contains an action 'Action1' that is scheduled to come before or after action 'Action3', which is also scheduled to come before or after action 'Action1'. Please remove this circular dependency by changing the Before or After attribute for one of the actions.", result.Messages[0].ToString()); | 36 | WixAssert.StringEqual("The InstallExecuteSequence table contains an action 'Action1' that is scheduled to come before or after action 'Action3', which is also scheduled to come before or after action 'Action1'. Please remove this circular dependency by changing the Before or After attribute for one of the actions.", result.Messages[0].ToString()); |
37 | } | 37 | } |
38 | } | 38 | } |
39 | 39 | ||
@@ -60,7 +60,7 @@ namespace WixToolsetTest.CoreIntegration | |||
60 | }); | 60 | }); |
61 | 61 | ||
62 | Assert.Equal(176, result.ExitCode); | 62 | Assert.Equal(176, result.ExitCode); |
63 | Assert.Equal("The InstallExecuteSequence table contains an action 'Action2' that is scheduled to come before or after action 'Action4', which is also scheduled to come before or after action 'Action2'. Please remove this circular dependency by changing the Before or After attribute for one of the actions.", result.Messages[0].ToString()); | 63 | WixAssert.StringEqual("The InstallExecuteSequence table contains an action 'Action2' that is scheduled to come before or after action 'Action4', which is also scheduled to come before or after action 'Action2'. Please remove this circular dependency by changing the Before or After attribute for one of the actions.", result.Messages[0].ToString()); |
64 | } | 64 | } |
65 | } | 65 | } |
66 | 66 | ||
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/DependencyExtensionFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/DependencyExtensionFixture.cs index 43dbf4f9..89c54c7e 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/DependencyExtensionFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/DependencyExtensionFixture.cs | |||
@@ -44,11 +44,8 @@ namespace WixToolsetTest.CoreIntegration | |||
44 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); | 44 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); |
45 | extractResult.AssertSuccess(); | 45 | extractResult.AssertSuccess(); |
46 | 46 | ||
47 | var provides = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Chain/burn:ExePackage/burn:Provides") | 47 | var provides = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/burn:ExePackage/burn:Provides"); |
48 | .Cast<XmlElement>() | 48 | WixAssert.CompareLineByLine(new[] |
49 | .Select(e => e.GetTestXml()) | ||
50 | .ToArray(); | ||
51 | WixAssert.CompareLineByLine(new string[] | ||
52 | { | 49 | { |
53 | "<Provides Key='DependencyTests_ExeA,v1.0' Version='1.0.0.0' DisplayName='Windows Installer XML Toolset' />", | 50 | "<Provides Key='DependencyTests_ExeA,v1.0' Version='1.0.0.0' DisplayName='Windows Installer XML Toolset' />", |
54 | }, provides); | 51 | }, provides); |
@@ -100,11 +97,8 @@ namespace WixToolsetTest.CoreIntegration | |||
100 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); | 97 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); |
101 | extractResult.AssertSuccess(); | 98 | extractResult.AssertSuccess(); |
102 | 99 | ||
103 | var provides = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Chain/burn:MsiPackage/burn:Provides") | 100 | var provides = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/burn:MsiPackage/burn:Provides"); |
104 | .Cast<XmlElement>() | 101 | WixAssert.CompareLineByLine(new[] |
105 | .Select(e => e.GetTestXml()) | ||
106 | .ToArray(); | ||
107 | WixAssert.CompareLineByLine(new string[] | ||
108 | { | 102 | { |
109 | "<Provides Key='UsingProvides' Version='1.0.0.0' DisplayName='MsiPackage' Imported='yes' />", | 103 | "<Provides Key='UsingProvides' Version='1.0.0.0' DisplayName='MsiPackage' Imported='yes' />", |
110 | }, provides); | 104 | }, provides); |
@@ -146,10 +140,7 @@ namespace WixToolsetTest.CoreIntegration | |||
146 | { | 140 | { |
147 | { "Registration", new List<string> { "Id" } }, | 141 | { "Registration", new List<string> { "Id" } }, |
148 | }; | 142 | }; |
149 | var registration = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Registration") | 143 | var registration = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Registration", ignoreAttributesByElementName); |
150 | .Cast<XmlElement>() | ||
151 | .Select(e => e.GetTestXml(ignoreAttributesByElementName)) | ||
152 | .ToArray(); | ||
153 | WixAssert.CompareLineByLine(new string[] | 144 | WixAssert.CompareLineByLine(new string[] |
154 | { | 145 | { |
155 | "<Registration Id='*' ExecutableName='test.exe' PerMachine='yes' Tag='' Version='1.0.0.0' ProviderKey='MyProviderKey,v1.0'><Arp DisplayName='BurnBundle' DisplayVersion='1.0.0.0' Publisher='Example Corporation' /></Registration>", | 146 | "<Registration Id='*' ExecutableName='test.exe' PerMachine='yes' Tag='' Version='1.0.0.0' ProviderKey='MyProviderKey,v1.0'><Arp DisplayName='BurnBundle' DisplayVersion='1.0.0.0' Publisher='Example Corporation' /></Registration>", |
@@ -172,8 +163,8 @@ namespace WixToolsetTest.CoreIntegration | |||
172 | 163 | ||
173 | private static void Build(string[] args) | 164 | private static void Build(string[] args) |
174 | { | 165 | { |
175 | var result = WixRunner.Execute(args) | 166 | var result = WixRunner.Execute(args); |
176 | .AssertSuccess(); | 167 | result.AssertSuccess(); |
177 | } | 168 | } |
178 | } | 169 | } |
179 | } | 170 | } |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/ExePackageFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/ExePackageFixture.cs index 32c207f7..cebed367 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/ExePackageFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/ExePackageFixture.cs | |||
@@ -48,10 +48,7 @@ namespace WixToolsetTest.CoreIntegration | |||
48 | { | 48 | { |
49 | { "ExePackage", new List<string> { "CacheId", "Size" } }, | 49 | { "ExePackage", new List<string> { "CacheId", "Size" } }, |
50 | }; | 50 | }; |
51 | var exePackages = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Chain/burn:ExePackage") | 51 | var exePackages = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/burn:ExePackage", ignoreAttributes); |
52 | .Cast<XmlElement>() | ||
53 | .Select(e => e.GetTestXml(ignoreAttributes)) | ||
54 | .ToArray(); | ||
55 | WixAssert.CompareLineByLine(new string[] | 52 | WixAssert.CompareLineByLine(new string[] |
56 | { | 53 | { |
57 | "<ExePackage Id='burn.exe' Cache='keep' CacheId='*' InstallSize='463360' Size='*' PerMachine='yes' Permanent='no' Vital='yes' RollbackBoundaryForward='WixDefaultBoundary' RollbackBoundaryBackward='WixDefaultBoundary' LogPathVariable='WixBundleLog_burn.exe' RollbackLogPathVariable='WixBundleRollbackLog_burn.exe' InstallArguments='-install' RepairArguments='-repair' Repairable='yes' DetectionType='arp' ArpId='id' ArpDisplayVersion='1.0.0.0'>" + | 54 | "<ExePackage Id='burn.exe' Cache='keep' CacheId='*' InstallSize='463360' Size='*' PerMachine='yes' Permanent='no' Vital='yes' RollbackBoundaryForward='WixDefaultBoundary' RollbackBoundaryBackward='WixDefaultBoundary' LogPathVariable='WixBundleLog_burn.exe' RollbackLogPathVariable='WixBundleRollbackLog_burn.exe' InstallArguments='-install' RepairArguments='-repair' Repairable='yes' DetectionType='arp' ArpId='id' ArpDisplayVersion='1.0.0.0'>" + |
@@ -101,10 +98,7 @@ namespace WixToolsetTest.CoreIntegration | |||
101 | { | 98 | { |
102 | { "ExePackage", new List<string> { "CacheId", "Size" } }, | 99 | { "ExePackage", new List<string> { "CacheId", "Size" } }, |
103 | }; | 100 | }; |
104 | var exePackages = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Chain/burn:ExePackage") | 101 | var exePackages = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/burn:ExePackage", ignoreAttributes); |
105 | .Cast<XmlElement>() | ||
106 | .Select(e => e.GetTestXml(ignoreAttributes)) | ||
107 | .ToArray(); | ||
108 | WixAssert.CompareLineByLine(new string[] | 102 | WixAssert.CompareLineByLine(new string[] |
109 | { | 103 | { |
110 | "<ExePackage Id='burn.exe' Cache='keep' CacheId='*' InstallSize='463360' Size='*' PerMachine='yes' Permanent='no' Vital='yes' RollbackBoundaryForward='WixDefaultBoundary' RollbackBoundaryBackward='WixDefaultBoundary' LogPathVariable='WixBundleLog_burn.exe' RollbackLogPathVariable='WixBundleRollbackLog_burn.exe' InstallArguments='-install' RepairArguments='' Repairable='no' DetectionType='arp' ArpId='id' ArpDisplayVersion='1.0.0.abc'>" + | 104 | "<ExePackage Id='burn.exe' Cache='keep' CacheId='*' InstallSize='463360' Size='*' PerMachine='yes' Permanent='no' Vital='yes' RollbackBoundaryForward='WixDefaultBoundary' RollbackBoundaryBackward='WixDefaultBoundary' LogPathVariable='WixBundleLog_burn.exe' RollbackLogPathVariable='WixBundleRollbackLog_burn.exe' InstallArguments='-install' RepairArguments='' Repairable='no' DetectionType='arp' ArpId='id' ArpDisplayVersion='1.0.0.abc'>" + |
@@ -154,10 +148,7 @@ namespace WixToolsetTest.CoreIntegration | |||
154 | { | 148 | { |
155 | { "ExePackage", new List<string> { "CacheId", "Size" } }, | 149 | { "ExePackage", new List<string> { "CacheId", "Size" } }, |
156 | }; | 150 | }; |
157 | var exePackages = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Chain/burn:ExePackage") | 151 | var exePackages = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/burn:ExePackage", ignoreAttributes); |
158 | .Cast<XmlElement>() | ||
159 | .Select(e => e.GetTestXml(ignoreAttributes)) | ||
160 | .ToArray(); | ||
161 | WixAssert.CompareLineByLine(new string[] | 152 | WixAssert.CompareLineByLine(new string[] |
162 | { | 153 | { |
163 | "<ExePackage Id='burn.exe' Cache='keep' CacheId='*' InstallSize='463360' Size='*' PerMachine='yes' Permanent='yes' Vital='yes' RollbackBoundaryForward='WixDefaultBoundary' RollbackBoundaryBackward='WixDefaultBoundary' LogPathVariable='WixBundleLog_burn.exe' RollbackLogPathVariable='WixBundleRollbackLog_burn.exe' InstallArguments='-install' RepairArguments='' Repairable='no' DetectionType='none'>" + | 154 | "<ExePackage Id='burn.exe' Cache='keep' CacheId='*' InstallSize='463360' Size='*' PerMachine='yes' Permanent='yes' Vital='yes' RollbackBoundaryForward='WixDefaultBoundary' RollbackBoundaryBackward='WixDefaultBoundary' LogPathVariable='WixBundleLog_burn.exe' RollbackLogPathVariable='WixBundleRollbackLog_burn.exe' InstallArguments='-install' RepairArguments='' Repairable='no' DetectionType='none'>" + |
@@ -203,10 +194,7 @@ namespace WixToolsetTest.CoreIntegration | |||
203 | { | 194 | { |
204 | { "ExePackage", new List<string> { "CacheId", "Size" } }, | 195 | { "ExePackage", new List<string> { "CacheId", "Size" } }, |
205 | }; | 196 | }; |
206 | var exePackages = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Chain/burn:ExePackage") | 197 | var exePackages = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/burn:ExePackage", ignoreAttributes); |
207 | .Cast<XmlElement>() | ||
208 | .Select(e => e.GetTestXml(ignoreAttributes)) | ||
209 | .ToArray(); | ||
210 | WixAssert.CompareLineByLine(new string[] | 198 | WixAssert.CompareLineByLine(new string[] |
211 | { | 199 | { |
212 | "<ExePackage Id='burn.exe' Cache='keep' CacheId='*' InstallSize='463360' Size='*' PerMachine='yes' Permanent='yes' Vital='yes' RollbackBoundaryForward='WixDefaultBoundary' RollbackBoundaryBackward='WixDefaultBoundary' LogPathVariable='WixBundleLog_burn.exe' RollbackLogPathVariable='WixBundleRollbackLog_burn.exe' InstallArguments='-install' RepairArguments='' Repairable='no' DetectionType='none'>" + | 200 | "<ExePackage Id='burn.exe' Cache='keep' CacheId='*' InstallSize='463360' Size='*' PerMachine='yes' Permanent='yes' Vital='yes' RollbackBoundaryForward='WixDefaultBoundary' RollbackBoundaryBackward='WixDefaultBoundary' LogPathVariable='WixBundleLog_burn.exe' RollbackLogPathVariable='WixBundleRollbackLog_burn.exe' InstallArguments='-install' RepairArguments='' Repairable='no' DetectionType='none'>" + |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs index a5155069..e7ff0230 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs | |||
@@ -43,7 +43,7 @@ namespace WixToolsetTest.CoreIntegration | |||
43 | build.BuildAndDecompileAndBuild(Build, Decompile, actualOutputPath); | 43 | build.BuildAndDecompileAndBuild(Build, Decompile, actualOutputPath); |
44 | 44 | ||
45 | var expected = File.ReadAllLines(expectedOutputPath); | 45 | var expected = File.ReadAllLines(expectedOutputPath); |
46 | var actual = File.ReadAllLines(actualOutputPath).Select(ReplaceGuids).ToArray(); ; | 46 | var actual = File.ReadAllLines(actualOutputPath).Select(ReplaceGuids).ToArray(); |
47 | WixAssert.CompareLineByLine(expected, actual); | 47 | WixAssert.CompareLineByLine(expected, actual); |
48 | } | 48 | } |
49 | } | 49 | } |
@@ -87,13 +87,13 @@ namespace WixToolsetTest.CoreIntegration | |||
87 | var section = intermediate.Sections.Single(); | 87 | var section = intermediate.Sections.Single(); |
88 | 88 | ||
89 | var fileSymbol = section.Symbols.OfType<FileSymbol>().Single(); | 89 | var fileSymbol = section.Symbols.OfType<FileSymbol>().Single(); |
90 | Assert.Equal(Path.Combine(folder, @"data\example.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path); | 90 | WixAssert.StringEqual(Path.Combine(folder, @"data\example.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path); |
91 | Assert.Equal(@"example.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); | 91 | WixAssert.StringEqual(@"example.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); |
92 | 92 | ||
93 | var example = section.Symbols.Where(t => t.Definition.Type == SymbolDefinitionType.MustBeFromAnExtension).Single(); | 93 | var example = section.Symbols.Where(t => t.Definition.Type == SymbolDefinitionType.MustBeFromAnExtension).Single(); |
94 | Assert.Equal("Foo", example.Id?.Id); | 94 | WixAssert.StringEqual("Foo", example.Id?.Id); |
95 | Assert.Equal("filF5_pLhBuF5b4N9XEo52g_hUM5Lo", example[0].AsString()); | 95 | WixAssert.StringEqual("filF5_pLhBuF5b4N9XEo52g_hUM5Lo", example[0].AsString()); |
96 | Assert.Equal("Bar", example[1].AsString()); | 96 | WixAssert.StringEqual("Bar", example[1].AsString()); |
97 | } | 97 | } |
98 | } | 98 | } |
99 | 99 | ||
@@ -126,8 +126,8 @@ namespace WixToolsetTest.CoreIntegration | |||
126 | var section = intermediate.Sections.Single(); | 126 | var section = intermediate.Sections.Single(); |
127 | 127 | ||
128 | var property = section.Symbols.OfType<PropertySymbol>().Where(p => p.Id.Id == "ExampleProperty").Single(); | 128 | var property = section.Symbols.OfType<PropertySymbol>().Where(p => p.Id.Id == "ExampleProperty").Single(); |
129 | Assert.Equal("ExampleProperty", property.Id.Id); | 129 | WixAssert.StringEqual("ExampleProperty", property.Id.Id); |
130 | Assert.Equal("test", property.Value); | 130 | WixAssert.StringEqual("test", property.Value); |
131 | } | 131 | } |
132 | } | 132 | } |
133 | 133 | ||
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/LinkerFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/LinkerFixture.cs index cfe4d3f1..ad8707c6 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/LinkerFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/LinkerFixture.cs | |||
@@ -103,7 +103,7 @@ namespace WixToolsetTest.CoreIntegration | |||
103 | } | 103 | } |
104 | catch (WixException we) | 104 | catch (WixException we) |
105 | { | 105 | { |
106 | Assert.Equal("Could not find entry section in provided list of intermediates. Expected section of type 'Product'.", we.Message); | 106 | WixAssert.StringEqual("Could not find entry section in provided list of intermediates. Expected section of type 'Product'.", we.Message); |
107 | return; | 107 | return; |
108 | } | 108 | } |
109 | 109 | ||
@@ -133,7 +133,7 @@ namespace WixToolsetTest.CoreIntegration | |||
133 | } | 133 | } |
134 | catch (WixException we) | 134 | catch (WixException we) |
135 | { | 135 | { |
136 | Assert.Equal("Could not find entry section in provided list of intermediates. Supported entry section types are: Product, Bundle, Patch, PatchCreation, Module.", we.Message); | 136 | WixAssert.StringEqual("Could not find entry section in provided list of intermediates. Supported entry section types are: Product, Bundle, Patch, PatchCreation, Module.", we.Message); |
137 | return; | 137 | return; |
138 | } | 138 | } |
139 | 139 | ||
@@ -163,7 +163,7 @@ namespace WixToolsetTest.CoreIntegration | |||
163 | } | 163 | } |
164 | catch (WixException we) | 164 | catch (WixException we) |
165 | { | 165 | { |
166 | Assert.Equal("Could not find entry section in provided list of intermediates. Supported entry section types are: Product, Bundle, Patch, PatchCreation, Module.", we.Message); | 166 | WixAssert.StringEqual("Could not find entry section in provided list of intermediates. Supported entry section types are: Product, Bundle, Patch, PatchCreation, Module.", we.Message); |
167 | return; | 167 | return; |
168 | } | 168 | } |
169 | 169 | ||
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/ModuleFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/ModuleFixture.cs index 234aec78..af200c0d 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/ModuleFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/ModuleFixture.cs | |||
@@ -2,14 +2,9 @@ | |||
2 | 2 | ||
3 | namespace WixToolsetTest.CoreIntegration | 3 | namespace WixToolsetTest.CoreIntegration |
4 | { | 4 | { |
5 | using System; | ||
6 | using System.IO; | 5 | using System.IO; |
7 | using System.Linq; | ||
8 | using WixBuildTools.TestSupport; | 6 | using WixBuildTools.TestSupport; |
9 | using WixToolset.Core.TestPackage; | 7 | using WixToolset.Core.TestPackage; |
10 | using WixToolset.Data; | ||
11 | using WixToolset.Data.Symbols; | ||
12 | using WixToolset.Data.WindowsInstaller; | ||
13 | using Xunit; | 8 | using Xunit; |
14 | 9 | ||
15 | public class ModuleFixture | 10 | public class ModuleFixture |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/MsiFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/MsiFixture.cs index cb1ecb04..c1c07952 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/MsiFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/MsiFixture.cs | |||
@@ -52,8 +52,8 @@ namespace WixToolsetTest.CoreIntegration | |||
52 | var section = intermediate.Sections.Single(); | 52 | var section = intermediate.Sections.Single(); |
53 | 53 | ||
54 | var fileSymbol = section.Symbols.OfType<FileSymbol>().First(); | 54 | var fileSymbol = section.Symbols.OfType<FileSymbol>().First(); |
55 | Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path); | 55 | WixAssert.StringEqual(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path); |
56 | Assert.Equal(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); | 56 | WixAssert.StringEqual(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); |
57 | } | 57 | } |
58 | } | 58 | } |
59 | 59 | ||
@@ -87,8 +87,8 @@ namespace WixToolsetTest.CoreIntegration | |||
87 | var section = intermediate.Sections.Single(); | 87 | var section = intermediate.Sections.Single(); |
88 | 88 | ||
89 | var fileSymbol = section.Symbols.OfType<FileSymbol>().Single(); | 89 | var fileSymbol = section.Symbols.OfType<FileSymbol>().Single(); |
90 | Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path); | 90 | WixAssert.StringEqual(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path); |
91 | Assert.Equal(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); | 91 | WixAssert.StringEqual(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); |
92 | } | 92 | } |
93 | } | 93 | } |
94 | 94 | ||
@@ -246,14 +246,14 @@ namespace WixToolsetTest.CoreIntegration | |||
246 | var section = intermediate.Sections.Single(); | 246 | var section = intermediate.Sections.Single(); |
247 | 247 | ||
248 | var errors = section.Symbols.OfType<ErrorSymbol>().ToDictionary(t => t.Id.Id); | 248 | var errors = section.Symbols.OfType<ErrorSymbol>().ToDictionary(t => t.Id.Id); |
249 | Assert.Equal("Category 55 Emergency Doomsday Crisis", errors["1234"].Message.Trim()); | 249 | WixAssert.StringEqual("Category 55 Emergency Doomsday Crisis", errors["1234"].Message.Trim()); |
250 | Assert.Equal(" ", errors["5678"].Message); | 250 | WixAssert.StringEqual(" ", errors["5678"].Message); |
251 | 251 | ||
252 | var customAction1 = section.Symbols.OfType<CustomActionSymbol>().Where(t => t.Id.Id == "CanWeReferenceAnError_YesWeCan").Single(); | 252 | var customAction1 = section.Symbols.OfType<CustomActionSymbol>().Where(t => t.Id.Id == "CanWeReferenceAnError_YesWeCan").Single(); |
253 | Assert.Equal("1234", customAction1.Target); | 253 | WixAssert.StringEqual("1234", customAction1.Target); |
254 | 254 | ||
255 | var customAction2 = section.Symbols.OfType<CustomActionSymbol>().Where(t => t.Id.Id == "TextErrorsWorkOKToo").Single(); | 255 | var customAction2 = section.Symbols.OfType<CustomActionSymbol>().Where(t => t.Id.Id == "TextErrorsWorkOKToo").Single(); |
256 | Assert.Equal("If you see this, something went wrong.", customAction2.Target); | 256 | WixAssert.StringEqual("If you see this, something went wrong.", customAction2.Target); |
257 | } | 257 | } |
258 | } | 258 | } |
259 | 259 | ||
@@ -461,7 +461,7 @@ namespace WixToolsetTest.CoreIntegration | |||
461 | Assert.NotNull(wixout.GetDataStream("wix-ir.json")); | 461 | Assert.NotNull(wixout.GetDataStream("wix-ir.json")); |
462 | 462 | ||
463 | var text = wixout.GetData("wix-ir/test.txt"); | 463 | var text = wixout.GetData("wix-ir/test.txt"); |
464 | Assert.Equal("This is test.txt.", text); | 464 | WixAssert.StringEqual("This is test.txt.", text); |
465 | } | 465 | } |
466 | } | 466 | } |
467 | } | 467 | } |
@@ -491,13 +491,13 @@ namespace WixToolsetTest.CoreIntegration | |||
491 | Assert.NotNull(wixout.GetDataStream("wix-ir.json")); | 491 | Assert.NotNull(wixout.GetDataStream("wix-ir.json")); |
492 | 492 | ||
493 | var text = wixout.GetData("wix-ir/test.txt"); | 493 | var text = wixout.GetData("wix-ir/test.txt"); |
494 | Assert.Equal(@"This is a\test.txt.", text); | 494 | WixAssert.StringEqual(@"This is a\test.txt.", text); |
495 | 495 | ||
496 | var text2 = wixout.GetData("wix-ir/test.txt-1"); | 496 | var text2 = wixout.GetData("wix-ir/test.txt-1"); |
497 | Assert.Equal(@"This is b\test.txt.", text2); | 497 | WixAssert.StringEqual(@"This is b\test.txt.", text2); |
498 | 498 | ||
499 | var text3 = wixout.GetData("wix-ir/test.txt-2"); | 499 | var text3 = wixout.GetData("wix-ir/test.txt-2"); |
500 | Assert.Equal(@"This is c\test.txt.", text3); | 500 | WixAssert.StringEqual(@"This is c\test.txt.", text3); |
501 | } | 501 | } |
502 | } | 502 | } |
503 | } | 503 | } |
@@ -533,8 +533,8 @@ namespace WixToolsetTest.CoreIntegration | |||
533 | var section = intermediate.Sections.Single(); | 533 | var section = intermediate.Sections.Single(); |
534 | 534 | ||
535 | var fileSymbol = section.Symbols.OfType<FileSymbol>().Single(); | 535 | var fileSymbol = section.Symbols.OfType<FileSymbol>().Single(); |
536 | Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path); | 536 | WixAssert.StringEqual(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path); |
537 | Assert.Equal(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); | 537 | WixAssert.StringEqual(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); |
538 | } | 538 | } |
539 | } | 539 | } |
540 | 540 | ||
@@ -569,8 +569,8 @@ namespace WixToolsetTest.CoreIntegration | |||
569 | var section = intermediate.Sections.Single(); | 569 | var section = intermediate.Sections.Single(); |
570 | 570 | ||
571 | var fileSymbol = section.Symbols.OfType<FileSymbol>().Single(); | 571 | var fileSymbol = section.Symbols.OfType<FileSymbol>().Single(); |
572 | Assert.Equal(Path.Combine(folder, @"data\candle.exe"), fileSymbol[FileSymbolFields.Source].AsPath().Path); | 572 | WixAssert.StringEqual(Path.Combine(folder, @"data\candle.exe"), fileSymbol[FileSymbolFields.Source].AsPath().Path); |
573 | Assert.Equal(@"candle.exe", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); | 573 | WixAssert.StringEqual(@"candle.exe", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); |
574 | 574 | ||
575 | var msiAssemblyNameSymbols = section.Symbols.OfType<MsiAssemblyNameSymbol>(); | 575 | var msiAssemblyNameSymbols = section.Symbols.OfType<MsiAssemblyNameSymbol>(); |
576 | WixAssert.CompareLineByLine(new[] | 576 | WixAssert.CompareLineByLine(new[] |
@@ -626,8 +626,8 @@ namespace WixToolsetTest.CoreIntegration | |||
626 | var section = intermediate.Sections.Single(); | 626 | var section = intermediate.Sections.Single(); |
627 | 627 | ||
628 | var fileSymbol = section.Symbols.OfType<FileSymbol>().Single(); | 628 | var fileSymbol = section.Symbols.OfType<FileSymbol>().Single(); |
629 | Assert.Equal(Path.Combine(folder, @"data\candle.exe"), fileSymbol[FileSymbolFields.Source].AsPath().Path); | 629 | WixAssert.StringEqual(Path.Combine(folder, @"data\candle.exe"), fileSymbol[FileSymbolFields.Source].AsPath().Path); |
630 | Assert.Equal(@"candle.exe", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); | 630 | WixAssert.StringEqual(@"candle.exe", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); |
631 | 631 | ||
632 | var msiAssemblyNameSymbols = section.Symbols.OfType<MsiAssemblyNameSymbol>(); | 632 | var msiAssemblyNameSymbols = section.Symbols.OfType<MsiAssemblyNameSymbol>(); |
633 | WixAssert.CompareLineByLine(new[] | 633 | WixAssert.CompareLineByLine(new[] |
@@ -744,10 +744,10 @@ namespace WixToolsetTest.CoreIntegration | |||
744 | 744 | ||
745 | var output = WindowsInstallerData.Load(Path.Combine(baseFolder, @"bin\test.wixpdb"), false); | 745 | var output = WindowsInstallerData.Load(Path.Combine(baseFolder, @"bin\test.wixpdb"), false); |
746 | var caRows = output.Tables["CustomAction"].Rows.Single(); | 746 | var caRows = output.Tables["CustomAction"].Rows.Single(); |
747 | Assert.Equal("SetINSTALLLOCATION", caRows.FieldAsString(0)); | 747 | WixAssert.StringEqual("SetINSTALLLOCATION", caRows.FieldAsString(0)); |
748 | Assert.Equal("51", caRows.FieldAsString(1)); | 748 | WixAssert.StringEqual("51", caRows.FieldAsString(1)); |
749 | Assert.Equal("INSTALLLOCATION", caRows.FieldAsString(2)); | 749 | WixAssert.StringEqual("INSTALLLOCATION", caRows.FieldAsString(2)); |
750 | Assert.Equal("[INSTALLFOLDER]", caRows.FieldAsString(3)); | 750 | WixAssert.StringEqual("[INSTALLFOLDER]", caRows.FieldAsString(3)); |
751 | } | 751 | } |
752 | } | 752 | } |
753 | 753 | ||
@@ -873,7 +873,7 @@ namespace WixToolsetTest.CoreIntegration | |||
873 | first => | 873 | first => |
874 | { | 874 | { |
875 | Assert.Equal(MessageLevel.Error, first.Level); | 875 | Assert.Equal(MessageLevel.Error, first.Level); |
876 | Assert.Equal("Cannot find the table definitions for the 'TableDefinitionNotExposedByExtension' table. This is likely due to a typing error or missing extension. Please ensure all the necessary extensions are supplied on the command line with the -ext parameter.", first.ToString()); | 876 | WixAssert.StringEqual("Cannot find the table definitions for the 'TableDefinitionNotExposedByExtension' table. This is likely due to a typing error or missing extension. Please ensure all the necessary extensions are supplied on the command line with the -ext parameter.", first.ToString()); |
877 | }); | 877 | }); |
878 | 878 | ||
879 | Assert.False(File.Exists(msiPath)); | 879 | Assert.False(File.Exists(msiPath)); |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/MsiTransactionFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/MsiTransactionFixture.cs index 431c131b..f4949171 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/MsiTransactionFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/MsiTransactionFixture.cs | |||
@@ -102,10 +102,12 @@ namespace WixToolsetTest.CoreIntegration | |||
102 | var extractResult = BundleExtractor.ExtractBAContainer(null, exePath, baFolderPath, extractFolderPath); | 102 | var extractResult = BundleExtractor.ExtractBAContainer(null, exePath, baFolderPath, extractFolderPath); |
103 | extractResult.AssertSuccess(); | 103 | extractResult.AssertSuccess(); |
104 | 104 | ||
105 | var rollbackBoundaries = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:RollbackBoundary"); | 105 | var rollbackBoundaries = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:RollbackBoundary"); |
106 | Assert.Equal(2, rollbackBoundaries.Count); | 106 | WixAssert.CompareLineByLine(new[] |
107 | Assert.Equal("<RollbackBoundary Id='WixDefaultBoundary' Vital='yes' Transaction='no' />", rollbackBoundaries[0].GetTestXml()); | 107 | { |
108 | Assert.Equal("<RollbackBoundary Id='rba31DvS6_ninGllmavuS.cp4RYckk' Vital='yes' Transaction='yes' LogPathVariable='WixBundleLog_rba31DvS6_ninGllmavuS.cp4RYckk' />", rollbackBoundaries[1].GetTestXml()); | 108 | "<RollbackBoundary Id='WixDefaultBoundary' Vital='yes' Transaction='no' />", |
109 | "<RollbackBoundary Id='rba31DvS6_ninGllmavuS.cp4RYckk' Vital='yes' Transaction='yes' LogPathVariable='WixBundleLog_rba31DvS6_ninGllmavuS.cp4RYckk' />", | ||
110 | }, rollbackBoundaries); | ||
109 | } | 111 | } |
110 | } | 112 | } |
111 | 113 | ||
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/PackagePayloadFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/PackagePayloadFixture.cs index da15026a..39caf8fd 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/PackagePayloadFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/PackagePayloadFixture.cs | |||
@@ -47,10 +47,7 @@ namespace WixToolsetTest.CoreIntegration | |||
47 | { | 47 | { |
48 | { "ExePackage", new List<string> { "CacheId", "InstallSize", "Size" } }, | 48 | { "ExePackage", new List<string> { "CacheId", "InstallSize", "Size" } }, |
49 | }; | 49 | }; |
50 | var msiPackageElements = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Chain/burn:MsiPackage") | 50 | var msiPackageElements = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/burn:MsiPackage", ignoreAttributesByElementName); |
51 | .Cast<XmlElement>() | ||
52 | .Select(e => e.GetTestXml(ignoreAttributesByElementName)) | ||
53 | .ToArray(); | ||
54 | WixAssert.CompareLineByLine(new[] | 51 | WixAssert.CompareLineByLine(new[] |
55 | { | 52 | { |
56 | "<MsiPackage Id='MsiWithFeatures' Cache='keep' CacheId='{040011E1-F84C-4927-AD62-50A5EC19CA32}v1.0.0.0_1' InstallSize='34' Size='32803' PerMachine='yes' Permanent='no' Vital='yes' RollbackBoundaryForward='WixDefaultBoundary' LogPathVariable='WixBundleLog_MsiWithFeatures' RollbackLogPathVariable='WixBundleRollbackLog_MsiWithFeatures' ProductCode='{040011E1-F84C-4927-AD62-50A5EC19CA32}' Language='1033' Version='1.0.0.0' UpgradeCode='{047730A5-30FE-4A62-A520-DA9381B8226A}'>" + | 53 | "<MsiPackage Id='MsiWithFeatures' Cache='keep' CacheId='{040011E1-F84C-4927-AD62-50A5EC19CA32}v1.0.0.0_1' InstallSize='34' Size='32803' PerMachine='yes' Permanent='no' Vital='yes' RollbackBoundaryForward='WixDefaultBoundary' LogPathVariable='WixBundleLog_MsiWithFeatures' RollbackLogPathVariable='WixBundleRollbackLog_MsiWithFeatures' ProductCode='{040011E1-F84C-4927-AD62-50A5EC19CA32}' Language='1033' Version='1.0.0.0' UpgradeCode='{047730A5-30FE-4A62-A520-DA9381B8226A}'>" + |
@@ -68,20 +65,14 @@ namespace WixToolsetTest.CoreIntegration | |||
68 | "</MsiPackage>", | 65 | "</MsiPackage>", |
69 | }, msiPackageElements); | 66 | }, msiPackageElements); |
70 | 67 | ||
71 | var packageElements = extractResult.SelectBADataNodes("/ba:BootstrapperApplicationData/ba:WixPackageProperties") | 68 | var packageElements = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixPackageProperties"); |
72 | .Cast<XmlElement>() | 69 | WixAssert.CompareLineByLine(new[] |
73 | .Select(e => e.GetTestXml()) | ||
74 | .ToArray(); | ||
75 | WixAssert.CompareLineByLine(new [] | ||
76 | { | 70 | { |
77 | "<WixPackageProperties Package='MsiWithFeatures' Vital='yes' DisplayName='MsiPackage' DownloadSize='32803' PackageSize='32803' InstalledSize='34' PackageType='Msi' Permanent='no' LogPathVariable='WixBundleLog_MsiWithFeatures' RollbackLogPathVariable='WixBundleRollbackLog_MsiWithFeatures' Compressed='yes' ProductCode='{040011E1-F84C-4927-AD62-50A5EC19CA32}' UpgradeCode='{047730A5-30FE-4A62-A520-DA9381B8226A}' Version='1.0.0.0' Cache='keep' />", | 71 | "<WixPackageProperties Package='MsiWithFeatures' Vital='yes' DisplayName='MsiPackage' DownloadSize='32803' PackageSize='32803' InstalledSize='34' PackageType='Msi' Permanent='no' LogPathVariable='WixBundleLog_MsiWithFeatures' RollbackLogPathVariable='WixBundleRollbackLog_MsiWithFeatures' Compressed='yes' ProductCode='{040011E1-F84C-4927-AD62-50A5EC19CA32}' UpgradeCode='{047730A5-30FE-4A62-A520-DA9381B8226A}' Version='1.0.0.0' Cache='keep' />", |
78 | "<WixPackageProperties Package='MsiWithoutFeatures' Vital='yes' DisplayName='MsiPackage' DownloadSize='32803' PackageSize='32803' InstalledSize='34' PackageType='Msi' Permanent='no' LogPathVariable='WixBundleLog_MsiWithoutFeatures' RollbackLogPathVariable='WixBundleRollbackLog_MsiWithoutFeatures' Compressed='yes' ProductCode='{040011E1-F84C-4927-AD62-50A5EC19CA32}' UpgradeCode='{047730A5-30FE-4A62-A520-DA9381B8226A}' Version='1.0.0.0' Cache='keep' />", | 72 | "<WixPackageProperties Package='MsiWithoutFeatures' Vital='yes' DisplayName='MsiPackage' DownloadSize='32803' PackageSize='32803' InstalledSize='34' PackageType='Msi' Permanent='no' LogPathVariable='WixBundleLog_MsiWithoutFeatures' RollbackLogPathVariable='WixBundleRollbackLog_MsiWithoutFeatures' Compressed='yes' ProductCode='{040011E1-F84C-4927-AD62-50A5EC19CA32}' UpgradeCode='{047730A5-30FE-4A62-A520-DA9381B8226A}' Version='1.0.0.0' Cache='keep' />", |
79 | }, packageElements); | 73 | }, packageElements); |
80 | 74 | ||
81 | var featureElements = extractResult.SelectBADataNodes("/ba:BootstrapperApplicationData/ba:WixPackageFeatureInfo") | 75 | var featureElements = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixPackageFeatureInfo"); |
82 | .Cast<XmlElement>() | ||
83 | .Select(e => e.GetTestXml()) | ||
84 | .ToArray(); | ||
85 | WixAssert.CompareLineByLine(new[] | 76 | WixAssert.CompareLineByLine(new[] |
86 | { | 77 | { |
87 | "<WixPackageFeatureInfo Package='MsiWithFeatures' Feature='ProductFeature' Size='34' Display='2' Level='1' Directory='' Attributes='0' />", | 78 | "<WixPackageFeatureInfo Package='MsiWithFeatures' Feature='ProductFeature' Size='34' Display='2' Level='1' Directory='' Attributes='0' />", |
@@ -120,17 +111,21 @@ namespace WixToolsetTest.CoreIntegration | |||
120 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); | 111 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); |
121 | extractResult.AssertSuccess(); | 112 | extractResult.AssertSuccess(); |
122 | 113 | ||
123 | var exePackageElements = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Chain/burn:ExePackage"); | ||
124 | var ignoreAttributesByElementName = new Dictionary<string, List<string>> | 114 | var ignoreAttributesByElementName = new Dictionary<string, List<string>> |
125 | { | 115 | { |
126 | { "ExePackage", new List<string> { "CacheId", "InstallSize", "Size" } }, | 116 | { "ExePackage", new List<string> { "CacheId", "InstallSize", "Size" } }, |
127 | }; | 117 | }; |
128 | Assert.Equal(1, exePackageElements.Count); | 118 | var exePackageElements = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/burn:ExePackage", ignoreAttributesByElementName); |
129 | Assert.Equal("<ExePackage Id='PackagePayloadInPayloadGroup' Cache='keep' CacheId='*' InstallSize='*' Size='*' PerMachine='yes' Permanent='yes' Vital='yes' RollbackBoundaryForward='WixDefaultBoundary' RollbackBoundaryBackward='WixDefaultBoundary' LogPathVariable='WixBundleLog_PackagePayloadInPayloadGroup' RollbackLogPathVariable='WixBundleRollbackLog_PackagePayloadInPayloadGroup' InstallArguments='' RepairArguments='' Repairable='no' DetectionType='condition' DetectCondition='none'><PayloadRef Id='burn.exe' /></ExePackage>", exePackageElements[0].GetTestXml(ignoreAttributesByElementName)); | 119 | WixAssert.CompareLineByLine(new[] |
120 | { | ||
121 | "<ExePackage Id='PackagePayloadInPayloadGroup' Cache='keep' CacheId='*' InstallSize='*' Size='*' PerMachine='yes' Permanent='yes' Vital='yes' RollbackBoundaryForward='WixDefaultBoundary' RollbackBoundaryBackward='WixDefaultBoundary' LogPathVariable='WixBundleLog_PackagePayloadInPayloadGroup' RollbackLogPathVariable='WixBundleRollbackLog_PackagePayloadInPayloadGroup' InstallArguments='' RepairArguments='' Repairable='no' DetectionType='condition' DetectCondition='none'><PayloadRef Id='burn.exe' /></ExePackage>", | ||
122 | }, exePackageElements); | ||
130 | 123 | ||
131 | var payloadElements = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Payload[@Id='burn.exe']"); | 124 | var payloadElements = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Payload[@Id='burn.exe']"); |
132 | Assert.Equal(1, payloadElements.Count); | 125 | WixAssert.CompareLineByLine(new[] |
133 | Assert.Equal("<Payload Id='burn.exe' FilePath='burn.exe' FileSize='463360' Hash='F6E722518AC3AB7E31C70099368D5770788C179AA23226110DCF07319B1E1964E246A1E8AE72E2CF23E0138AFC281BAFDE45969204405E114EB20C8195DA7E5E' Packaging='embedded' SourcePath='a0' Container='WixAttachedContainer' />", payloadElements[0].GetTestXml()); | 126 | { |
127 | "<Payload Id='burn.exe' FilePath='burn.exe' FileSize='463360' Hash='F6E722518AC3AB7E31C70099368D5770788C179AA23226110DCF07319B1E1964E246A1E8AE72E2CF23E0138AFC281BAFDE45969204405E114EB20C8195DA7E5E' Packaging='embedded' SourcePath='a0' Container='WixAttachedContainer' />", | ||
128 | }, payloadElements); | ||
134 | } | 129 | } |
135 | } | 130 | } |
136 | 131 | ||
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/PatchFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/PatchFixture.cs index 8fe790de..53c9ae4d 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/PatchFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/PatchFixture.cs | |||
@@ -40,7 +40,7 @@ namespace WixToolsetTest.CoreIntegration | |||
40 | Assert.True(File.Exists(update1Pdb)); | 40 | Assert.True(File.Exists(update1Pdb)); |
41 | 41 | ||
42 | var doc = GetExtractPatchXml(patchPath); | 42 | var doc = GetExtractPatchXml(patchPath); |
43 | Assert.Equal("{7D326855-E790-4A94-8611-5351F8321FCA}", doc.Root.Element(PatchNamespace + "TargetProductCode").Value); | 43 | WixAssert.StringEqual("{7D326855-E790-4A94-8611-5351F8321FCA}", doc.Root.Element(PatchNamespace + "TargetProductCode").Value); |
44 | 44 | ||
45 | var names = Query.GetSubStorageNames(patchPath); | 45 | var names = Query.GetSubStorageNames(patchPath); |
46 | WixAssert.CompareLineByLine(new[] { "#RTM.1", "RTM.1" }, names); | 46 | WixAssert.CompareLineByLine(new[] { "#RTM.1", "RTM.1" }, names); |
@@ -72,7 +72,7 @@ namespace WixToolsetTest.CoreIntegration | |||
72 | Assert.True(File.Exists(update1Pdb)); | 72 | Assert.True(File.Exists(update1Pdb)); |
73 | 73 | ||
74 | var doc = GetExtractPatchXml(patchPath); | 74 | var doc = GetExtractPatchXml(patchPath); |
75 | Assert.Equal("{7D326855-E790-4A94-8611-5351F8321FCA}", doc.Root.Element(PatchNamespace + "TargetProductCode").Value); | 75 | WixAssert.StringEqual("{7D326855-E790-4A94-8611-5351F8321FCA}", doc.Root.Element(PatchNamespace + "TargetProductCode").Value); |
76 | 76 | ||
77 | var names = Query.GetSubStorageNames(patchPath); | 77 | var names = Query.GetSubStorageNames(patchPath); |
78 | WixAssert.CompareLineByLine(new[] { "#RTM.1", "RTM.1" }, names); | 78 | WixAssert.CompareLineByLine(new[] { "#RTM.1", "RTM.1" }, names); |
@@ -158,9 +158,11 @@ namespace WixToolsetTest.CoreIntegration | |||
158 | var doc = new XmlDocument(); | 158 | var doc = new XmlDocument(); |
159 | doc.LoadXml(manifestData); | 159 | doc.LoadXml(manifestData); |
160 | var nsmgr = BundleExtractor.GetBurnNamespaceManager(doc, "w"); | 160 | var nsmgr = BundleExtractor.GetBurnNamespaceManager(doc, "w"); |
161 | var slipstreamMspNodes = doc.SelectNodes("/w:BurnManifest/w:Chain/w:MsiPackage/w:SlipstreamMsp", nsmgr); | 161 | var slipstreamMspNodes = doc.SelectNodes("/w:BurnManifest/w:Chain/w:MsiPackage/w:SlipstreamMsp", nsmgr).GetTestXmlLines(); |
162 | Assert.Equal(1, slipstreamMspNodes.Count); | 162 | WixAssert.CompareLineByLine(new[] |
163 | Assert.Equal("<SlipstreamMsp Id='PatchA' />", slipstreamMspNodes[0].GetTestXml()); | 163 | { |
164 | "<SlipstreamMsp Id='PatchA' />", | ||
165 | }, slipstreamMspNodes); | ||
164 | } | 166 | } |
165 | } | 167 | } |
166 | } | 168 | } |
@@ -173,15 +175,9 @@ namespace WixToolsetTest.CoreIntegration | |||
173 | var doc = new XmlDocument(); | 175 | var doc = new XmlDocument(); |
174 | doc.LoadXml(manifestData); | 176 | doc.LoadXml(manifestData); |
175 | var nsmgr = BundleExtractor.GetBurnNamespaceManager(doc, "w"); | 177 | var nsmgr = BundleExtractor.GetBurnNamespaceManager(doc, "w"); |
176 | var patchTargetCodes = doc.SelectNodes("/w:BurnManifest/w:PatchTargetCode", nsmgr); | 178 | var patchTargetCodes = doc.SelectNodes("/w:BurnManifest/w:PatchTargetCode", nsmgr).GetTestXmlLines(); |
177 | 179 | ||
178 | var actual = new List<string>(); | 180 | WixAssert.CompareLineByLine(expected, patchTargetCodes); |
179 | foreach (XmlNode patchTargetCodeNode in patchTargetCodes) | ||
180 | { | ||
181 | actual.Add(patchTargetCodeNode.GetTestXml()); | ||
182 | } | ||
183 | |||
184 | WixAssert.CompareLineByLine(expected, actual.ToArray()); | ||
185 | } | 181 | } |
186 | } | 182 | } |
187 | 183 | ||
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/PayloadFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/PayloadFixture.cs index a4f6a3fd..868b6c21 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/PayloadFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/PayloadFixture.cs | |||
@@ -2,6 +2,7 @@ | |||
2 | 2 | ||
3 | namespace WixToolsetTest.CoreIntegration | 3 | namespace WixToolsetTest.CoreIntegration |
4 | { | 4 | { |
5 | using System; | ||
5 | using System.Collections.Generic; | 6 | using System.Collections.Generic; |
6 | using System.IO; | 7 | using System.IO; |
7 | using System.Linq; | 8 | using System.Linq; |
@@ -47,7 +48,7 @@ namespace WixToolsetTest.CoreIntegration | |||
47 | ? field.AsNullableNumber()?.ToString() | 48 | ? field.AsNullableNumber()?.ToString() |
48 | : field?.AsString()) | 49 | : field?.AsString()) |
49 | .ToList(); | 50 | .ToList(); |
50 | Assert.Equal(@"dir\file.ext", fields[(int)WixBundlePayloadSymbolFields.Name]); | 51 | WixAssert.StringEqual(@"dir\file.ext", fields[(int)WixBundlePayloadSymbolFields.Name]); |
51 | } | 52 | } |
52 | } | 53 | } |
53 | 54 | ||
@@ -84,7 +85,7 @@ namespace WixToolsetTest.CoreIntegration | |||
84 | ? field.AsNullableNumber()?.ToString() | 85 | ? field.AsNullableNumber()?.ToString() |
85 | : field?.AsString()) | 86 | : field?.AsString()) |
86 | .ToList(); | 87 | .ToList(); |
87 | Assert.Equal(@"c\d\e\f.exe", fields[(int)WixBundlePayloadSymbolFields.Name]); | 88 | WixAssert.StringEqual(@"c\d\e\f.exe", fields[(int)WixBundlePayloadSymbolFields.Name]); |
88 | } | 89 | } |
89 | } | 90 | } |
90 | 91 | ||
@@ -107,7 +108,7 @@ namespace WixToolsetTest.CoreIntegration | |||
107 | "-o", wixlibPath, | 108 | "-o", wixlibPath, |
108 | }); | 109 | }); |
109 | 110 | ||
110 | Assert.InRange(result.ExitCode, 2, int.MaxValue); | 111 | Assert.InRange(result.ExitCode, 2, Int32.MaxValue); |
111 | 112 | ||
112 | var expectedIllegalRelativeLongFileName = 1; | 113 | var expectedIllegalRelativeLongFileName = 1; |
113 | var expectedPayloadMustBeRelativeToCache = 2; | 114 | var expectedPayloadMustBeRelativeToCache = 2; |
@@ -168,7 +169,7 @@ namespace WixToolsetTest.CoreIntegration | |||
168 | 169 | ||
169 | result.AssertSuccess(); | 170 | result.AssertSuccess(); |
170 | 171 | ||
171 | WixAssert.CompareLineByLine(new string[] | 172 | WixAssert.CompareLineByLine(new[] |
172 | { | 173 | { |
173 | "The Payload 'burn.exe' is being added to Container 'PackagesContainer', overriding its Compressed value of 'no'.", | 174 | "The Payload 'burn.exe' is being added to Container 'PackagesContainer', overriding its Compressed value of 'no'.", |
174 | }, result.Messages.Select(m => m.ToString()).ToArray()); | 175 | }, result.Messages.Select(m => m.ToString()).ToArray()); |
@@ -183,11 +184,8 @@ namespace WixToolsetTest.CoreIntegration | |||
183 | { "Container", new List<string> { "FileSize", "Hash" } }, | 184 | { "Container", new List<string> { "FileSize", "Hash" } }, |
184 | { "Payload", new List<string> { "FileSize", "Hash" } }, | 185 | { "Payload", new List<string> { "FileSize", "Hash" } }, |
185 | }; | 186 | }; |
186 | var payloads = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Payload") | 187 | var payloads = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Payload", ignoreAttributesByElementName); |
187 | .Cast<XmlElement>() | 188 | WixAssert.CompareLineByLine(new[] |
188 | .Select(e => e.GetTestXml(ignoreAttributesByElementName)) | ||
189 | .ToArray(); | ||
190 | WixAssert.CompareLineByLine(new string[] | ||
191 | { | 189 | { |
192 | "<Payload Id='burn.exe' FilePath='burn.exe' FileSize='*' Hash='*' Packaging='embedded' SourcePath='a0' Container='PackagesContainer' />", | 190 | "<Payload Id='burn.exe' FilePath='burn.exe' FileSize='*' Hash='*' Packaging='embedded' SourcePath='a0' Container='PackagesContainer' />", |
193 | "<Payload Id='test.msi' FilePath='test.msi' FileSize='*' Hash='*' DownloadUrl='http://example.com/id/test.msi/test.msi' Packaging='external' SourcePath='test.msi' />", | 191 | "<Payload Id='test.msi' FilePath='test.msi' FileSize='*' Hash='*' DownloadUrl='http://example.com/id/test.msi/test.msi' Packaging='external' SourcePath='test.msi' />", |
@@ -196,11 +194,8 @@ namespace WixToolsetTest.CoreIntegration | |||
196 | @"<Payload Id='faf_OZ741BG7SJ6ZkcIvivZ2Yzo8' FilePath='MsiPackage\Shared.dll' FileSize='*' Hash='*' DownloadUrl='http://example.com/test.msiid/faf_OZ741BG7SJ6ZkcIvivZ2Yzo8/MsiPackage/Shared.dll' Packaging='external' SourcePath='MsiPackage\Shared.dll' />", | 194 | @"<Payload Id='faf_OZ741BG7SJ6ZkcIvivZ2Yzo8' FilePath='MsiPackage\Shared.dll' FileSize='*' Hash='*' DownloadUrl='http://example.com/test.msiid/faf_OZ741BG7SJ6ZkcIvivZ2Yzo8/MsiPackage/Shared.dll' Packaging='external' SourcePath='MsiPackage\Shared.dll' />", |
197 | }, payloads); | 195 | }, payloads); |
198 | 196 | ||
199 | var containers = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Container") | 197 | var containers = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Container", ignoreAttributesByElementName); |
200 | .Cast<XmlElement>() | 198 | WixAssert.CompareLineByLine(new[] |
201 | .Select(e => e.GetTestXml(ignoreAttributesByElementName)) | ||
202 | .ToArray(); | ||
203 | WixAssert.CompareLineByLine(new string[] | ||
204 | { | 199 | { |
205 | "<Container Id='PackagesContainer' FileSize='*' Hash='*' DownloadUrl='http://example.com/id/PackagesContainer/packages.cab' FilePath='packages.cab' />", | 200 | "<Container Id='PackagesContainer' FileSize='*' Hash='*' DownloadUrl='http://example.com/id/PackagesContainer/packages.cab' FilePath='packages.cab' />", |
206 | }, containers); | 201 | }, containers); |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/PreprocessorFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/PreprocessorFixture.cs index ae8a1bcc..3c023c2b 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/PreprocessorFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/PreprocessorFixture.cs | |||
@@ -34,10 +34,10 @@ namespace WixToolsetTest.CoreIntegration | |||
34 | 34 | ||
35 | var includedFile = result.IncludedFiles.Single(); | 35 | var includedFile = result.IncludedFiles.Single(); |
36 | Assert.NotNull(result.Document); | 36 | Assert.NotNull(result.Document); |
37 | Assert.Equal(includeFile, includedFile.Path); | 37 | WixAssert.StringEqual(includeFile, includedFile.Path); |
38 | Assert.Equal(sourcePath, includedFile.SourceLineNumbers.FileName); | 38 | WixAssert.StringEqual(sourcePath, includedFile.SourceLineNumbers.FileName); |
39 | Assert.Equal(1, includedFile.SourceLineNumbers.LineNumber.Value); | 39 | Assert.Equal(1, includedFile.SourceLineNumbers.LineNumber.Value); |
40 | Assert.Equal($"{sourcePath}*1", includedFile.SourceLineNumbers.QualifiedFileName); | 40 | WixAssert.StringEqual($"{sourcePath}*1", includedFile.SourceLineNumbers.QualifiedFileName); |
41 | Assert.Null(includedFile.SourceLineNumbers.Parent); | 41 | Assert.Null(includedFile.SourceLineNumbers.Parent); |
42 | } | 42 | } |
43 | 43 | ||
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/RegistryFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/RegistryFixture.cs index e4d95b5d..f0a2e7c9 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/RegistryFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/RegistryFixture.cs | |||
@@ -2,11 +2,8 @@ | |||
2 | 2 | ||
3 | namespace WixToolsetTest.CoreIntegration | 3 | namespace WixToolsetTest.CoreIntegration |
4 | { | 4 | { |
5 | using System; | ||
6 | using System.Collections.Generic; | ||
7 | using System.IO; | 5 | using System.IO; |
8 | using System.Linq; | 6 | using System.Linq; |
9 | using System.Text; | ||
10 | using WixBuildTools.TestSupport; | 7 | using WixBuildTools.TestSupport; |
11 | using WixToolset.Core.TestPackage; | 8 | using WixToolset.Core.TestPackage; |
12 | using WixToolset.Data; | 9 | using WixToolset.Data; |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/RollbackBoundaryFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/RollbackBoundaryFixture.cs index 3a79878d..6d089e79 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/RollbackBoundaryFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/RollbackBoundaryFixture.cs | |||
@@ -111,11 +111,8 @@ namespace WixToolsetTest.CoreIntegration | |||
111 | var extractResult = BundleExtractor.ExtractBAContainer(null, exePath, baFolderPath, extractFolderPath); | 111 | var extractResult = BundleExtractor.ExtractBAContainer(null, exePath, baFolderPath, extractFolderPath); |
112 | extractResult.AssertSuccess(); | 112 | extractResult.AssertSuccess(); |
113 | 113 | ||
114 | var rollbackBoundaries = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:RollbackBoundary") | 114 | var rollbackBoundaries = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:RollbackBoundary"); |
115 | .Cast<XmlElement>() | 115 | WixAssert.CompareLineByLine(new[] |
116 | .Select(e => e.GetTestXml()) | ||
117 | .ToArray(); | ||
118 | WixAssert.CompareLineByLine(new string[] | ||
119 | { | 116 | { |
120 | "<RollbackBoundary Id='First' Vital='yes' Transaction='no' />", | 117 | "<RollbackBoundary Id='First' Vital='yes' Transaction='no' />", |
121 | }, rollbackBoundaries); | 118 | }, rollbackBoundaries); |
@@ -124,11 +121,8 @@ namespace WixToolsetTest.CoreIntegration | |||
124 | { | 121 | { |
125 | { "MsiPackage", new List<string> { "Size" } }, | 122 | { "MsiPackage", new List<string> { "Size" } }, |
126 | }; | 123 | }; |
127 | var chainPackages = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Chain/*") | 124 | var chainPackages = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/*", ignoreAttributesByElementName); |
128 | .Cast<XmlElement>() | 125 | WixAssert.CompareLineByLine(new[] |
129 | .Select(e => e.GetTestXml(ignoreAttributesByElementName)) | ||
130 | .ToArray(); | ||
131 | WixAssert.CompareLineByLine(new string[] | ||
132 | { | 126 | { |
133 | "<MsiPackage Id='test.msi' Cache='keep' CacheId='{040011E1-F84C-4927-AD62-50A5EC19CA32}v1.0.0.0' InstallSize='34' Size='*' PerMachine='yes' Permanent='no' Vital='yes' RollbackBoundaryForward='First' RollbackBoundaryBackward='First' LogPathVariable='WixBundleLog_test.msi' RollbackLogPathVariable='WixBundleRollbackLog_test.msi' ProductCode='{040011E1-F84C-4927-AD62-50A5EC19CA32}' Language='1033' Version='1.0.0.0' UpgradeCode='{047730A5-30FE-4A62-A520-DA9381B8226A}'>" + | 127 | "<MsiPackage Id='test.msi' Cache='keep' CacheId='{040011E1-F84C-4927-AD62-50A5EC19CA32}v1.0.0.0' InstallSize='34' Size='*' PerMachine='yes' Permanent='no' Vital='yes' RollbackBoundaryForward='First' RollbackBoundaryBackward='First' LogPathVariable='WixBundleLog_test.msi' RollbackLogPathVariable='WixBundleRollbackLog_test.msi' ProductCode='{040011E1-F84C-4927-AD62-50A5EC19CA32}' Language='1033' Version='1.0.0.0' UpgradeCode='{047730A5-30FE-4A62-A520-DA9381B8226A}'>" + |
134 | "<MsiProperty Id='ARPSYSTEMCOMPONENT' Value='1' />" + | 128 | "<MsiProperty Id='ARPSYSTEMCOMPONENT' Value='1' />" + |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/SoftwareTagFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/SoftwareTagFixture.cs index 9573f60a..9ff97e8c 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/SoftwareTagFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/SoftwareTagFixture.cs | |||
@@ -93,8 +93,8 @@ namespace WixToolsetTest.CoreIntegration | |||
93 | 93 | ||
94 | private static void Build(string[] args) | 94 | private static void Build(string[] args) |
95 | { | 95 | { |
96 | var result = WixRunner.Execute(args) | 96 | var result = WixRunner.Execute(args); |
97 | .AssertSuccess(); | 97 | result.AssertSuccess(); |
98 | } | 98 | } |
99 | } | 99 | } |
100 | } | 100 | } |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/TestXmlFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/TestXmlFixture.cs index 5330305e..ef1f6aee 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/TestXmlFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/TestXmlFixture.cs | |||
@@ -3,6 +3,7 @@ | |||
3 | namespace WixToolsetTest.CoreIntegration | 3 | namespace WixToolsetTest.CoreIntegration |
4 | { | 4 | { |
5 | using System.Collections.Generic; | 5 | using System.Collections.Generic; |
6 | using WixBuildTools.TestSupport; | ||
6 | using WixToolset.Core.TestPackage; | 7 | using WixToolset.Core.TestPackage; |
7 | using Xunit; | 8 | using Xunit; |
8 | 9 | ||
@@ -19,7 +20,7 @@ namespace WixToolsetTest.CoreIntegration | |||
19 | </Top>"; | 20 | </Top>"; |
20 | var expected = "<Top One='f'><First Two='t'><Target One='*' Two='*' Three='c' /></First><Target One='*' Two='*' Three='y' /></Top>"; | 21 | var expected = "<Top One='f'><First Two='t'><Target One='*' Two='*' Three='c' /></First><Target One='*' Two='*' Three='y' /></Top>"; |
21 | var ignored = new Dictionary<string, List<string>> { { "Target", new List<string> { "One", "Two", "Missing" } } }; | 22 | var ignored = new Dictionary<string, List<string>> { { "Target", new List<string> { "One", "Two", "Missing" } } }; |
22 | Assert.Equal(expected, original.GetTestXml(ignored)); | 23 | WixAssert.StringEqual(expected, original.GetTestXml(ignored)); |
23 | } | 24 | } |
24 | 25 | ||
25 | [Fact] | 26 | [Fact] |
@@ -27,7 +28,7 @@ namespace WixToolsetTest.CoreIntegration | |||
27 | { | 28 | { |
28 | var original = "<Test Simple=\"\" EscapedDoubleQuote=\""\" SingleQuoteValue=\"'test'\" Alternating='\"' AlternatingEscaped='"' />"; | 29 | var original = "<Test Simple=\"\" EscapedDoubleQuote=\""\" SingleQuoteValue=\"'test'\" Alternating='\"' AlternatingEscaped='"' />"; |
29 | var expected = "<Test Simple='' EscapedDoubleQuote='\"' SingleQuoteValue=''test'' Alternating='\"' AlternatingEscaped='\"' />"; | 30 | var expected = "<Test Simple='' EscapedDoubleQuote='\"' SingleQuoteValue=''test'' Alternating='\"' AlternatingEscaped='\"' />"; |
30 | Assert.Equal(expected, original.GetTestXml()); | 31 | WixAssert.StringEqual(expected, original.GetTestXml()); |
31 | } | 32 | } |
32 | 33 | ||
33 | [Fact] | 34 | [Fact] |
@@ -35,7 +36,7 @@ namespace WixToolsetTest.CoreIntegration | |||
35 | { | 36 | { |
36 | var original = "<Test xmlns='a'><Child xmlns:b='b'><Grandchild xmlns:c='c' /><Grandchild /></Child></Test>"; | 37 | var original = "<Test xmlns='a'><Child xmlns:b='b'><Grandchild xmlns:c='c' /><Grandchild /></Child></Test>"; |
37 | var expected = "<Test><Child><Grandchild /><Grandchild /></Child></Test>"; | 38 | var expected = "<Test><Child><Grandchild /><Grandchild /></Child></Test>"; |
38 | Assert.Equal(expected, original.GetTestXml()); | 39 | WixAssert.StringEqual(expected, original.GetTestXml()); |
39 | } | 40 | } |
40 | 41 | ||
41 | [Fact] | 42 | [Fact] |
@@ -48,7 +49,7 @@ namespace WixToolsetTest.CoreIntegration | |||
48 | </Child> | 49 | </Child> |
49 | </Test>"; | 50 | </Test>"; |
50 | var expected = "<Test><Child><Grandchild /><Grandchild /></Child></Test>"; | 51 | var expected = "<Test><Child><Grandchild /><Grandchild /></Child></Test>"; |
51 | Assert.Equal(expected, original.GetTestXml()); | 52 | WixAssert.StringEqual(expected, original.GetTestXml()); |
52 | } | 53 | } |
53 | 54 | ||
54 | [Fact] | 55 | [Fact] |
@@ -56,7 +57,7 @@ namespace WixToolsetTest.CoreIntegration | |||
56 | { | 57 | { |
57 | var original = "<?xml version='1.0'?><Test />"; | 58 | var original = "<?xml version='1.0'?><Test />"; |
58 | var expected = "<Test />"; | 59 | var expected = "<Test />"; |
59 | Assert.Equal(expected, original.GetTestXml()); | 60 | WixAssert.StringEqual(expected, original.GetTestXml()); |
60 | } | 61 | } |
61 | } | 62 | } |
62 | } | 63 | } |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/TransformFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/TransformFixture.cs index bdbf5c26..d69e0222 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/TransformFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/TransformFixture.cs | |||
@@ -120,10 +120,10 @@ namespace WixToolsetTest.CoreIntegration | |||
120 | }, rows.Keys.OrderBy(s => s).ToArray()); | 120 | }, rows.Keys.OrderBy(s => s).ToArray()); |
121 | 121 | ||
122 | Assert.True(rows.TryGetValue("ProductFeature", out var productFeatureRow)); | 122 | Assert.True(rows.TryGetValue("ProductFeature", out var productFeatureRow)); |
123 | Assert.Equal("MsiPackage ja-jp", productFeatureRow.FieldAsString(2)); | 123 | WixAssert.StringEqual("MsiPackage ja-jp", productFeatureRow.FieldAsString(2)); |
124 | 124 | ||
125 | Assert.True(rows.TryGetValue("ProductLanguage", out var productLanguageRow)); | 125 | Assert.True(rows.TryGetValue("ProductLanguage", out var productLanguageRow)); |
126 | Assert.Equal("1041", productLanguageRow.FieldAsString(1)); | 126 | WixAssert.StringEqual("1041", productLanguageRow.FieldAsString(1)); |
127 | 127 | ||
128 | Assert.False(File.Exists(mstPath)); | 128 | Assert.False(File.Exists(mstPath)); |
129 | 129 | ||
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/UpgradeFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/UpgradeFixture.cs index 39ccc683..5a4c2aae 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/UpgradeFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/UpgradeFixture.cs | |||
@@ -34,8 +34,13 @@ namespace WixToolsetTest.CoreIntegration | |||
34 | "-o", msiPath | 34 | "-o", msiPath |
35 | }); | 35 | }); |
36 | 36 | ||
37 | var message = result.Messages.Single(m => m.Level == MessageLevel.Error); | 37 | var errorMessages = result.Messages.Where(m => m.Level == MessageLevel.Error) |
38 | Assert.Equal("Invalid product version '1.256.0'. Product version must have a major version less than 256, a minor version less than 256, and a build version less than 65536.", message.ToString()); | 38 | .Select(m => m.ToString()) |
39 | .ToArray(); | ||
40 | WixAssert.CompareLineByLine(new[] | ||
41 | { | ||
42 | "Invalid product version '1.256.0'. Product version must have a major version less than 256, a minor version less than 256, and a build version less than 65536.", | ||
43 | }, errorMessages); | ||
39 | Assert.Equal(242, result.ExitCode); | 44 | Assert.Equal(242, result.ExitCode); |
40 | } | 45 | } |
41 | } | 46 | } |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/VariableResolverFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/VariableResolverFixture.cs index 15e5d334..f8331a86 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/VariableResolverFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/VariableResolverFixture.cs | |||
@@ -4,6 +4,7 @@ | |||
4 | namespace WixToolsetTest.CoreIntegration | 4 | namespace WixToolsetTest.CoreIntegration |
5 | { | 5 | { |
6 | using System.Collections.Generic; | 6 | using System.Collections.Generic; |
7 | using WixBuildTools.TestSupport; | ||
7 | using WixToolset.Core; | 8 | using WixToolset.Core; |
8 | using WixToolset.Data; | 9 | using WixToolset.Data; |
9 | using WixToolset.Data.Bind; | 10 | using WixToolset.Data.Bind; |
@@ -30,23 +31,23 @@ namespace WixToolsetTest.CoreIntegration | |||
30 | variableResolver.AddLocalization(localization); | 31 | variableResolver.AddLocalization(localization); |
31 | 32 | ||
32 | var result = variableResolver.ResolveVariables(null, "These are not the loc strings you're looking for."); | 33 | var result = variableResolver.ResolveVariables(null, "These are not the loc strings you're looking for."); |
33 | Assert.Equal("These are not the loc strings you're looking for.", result.Value); | 34 | WixAssert.StringEqual("These are not the loc strings you're looking for.", result.Value); |
34 | Assert.False(result.UpdatedValue); | 35 | Assert.False(result.UpdatedValue); |
35 | 36 | ||
36 | result = variableResolver.ResolveVariables(null, "Welcome to !(loc.ProductName)"); | 37 | result = variableResolver.ResolveVariables(null, "Welcome to !(loc.ProductName)"); |
37 | Assert.Equal("Welcome to Localized Product Name", result.Value); | 38 | WixAssert.StringEqual("Welcome to Localized Product Name", result.Value); |
38 | Assert.True(result.UpdatedValue); | 39 | Assert.True(result.UpdatedValue); |
39 | 40 | ||
40 | result = variableResolver.ResolveVariables(null, "Welcome to !(loc.ProductNameEdition)"); | 41 | result = variableResolver.ResolveVariables(null, "Welcome to !(loc.ProductNameEdition)"); |
41 | Assert.Equal("Welcome to Localized Product Name Enterprise Edition", result.Value); | 42 | WixAssert.StringEqual("Welcome to Localized Product Name Enterprise Edition", result.Value); |
42 | Assert.True(result.UpdatedValue); | 43 | Assert.True(result.UpdatedValue); |
43 | 44 | ||
44 | result = variableResolver.ResolveVariables(null, "Welcome to !(loc.ProductNameEditionVersion)"); | 45 | result = variableResolver.ResolveVariables(null, "Welcome to !(loc.ProductNameEditionVersion)"); |
45 | Assert.Equal("Welcome to Localized Product Name Enterprise Edition v1.2.3", result.Value); | 46 | WixAssert.StringEqual("Welcome to Localized Product Name Enterprise Edition v1.2.3", result.Value); |
46 | Assert.True(result.UpdatedValue); | 47 | Assert.True(result.UpdatedValue); |
47 | 48 | ||
48 | result = variableResolver.ResolveVariables(null, "Welcome to !(bind.property.ProductVersion)"); | 49 | result = variableResolver.ResolveVariables(null, "Welcome to !(bind.property.ProductVersion)"); |
49 | Assert.Equal("Welcome to !(bind.property.ProductVersion)", result.Value); | 50 | WixAssert.StringEqual("Welcome to !(bind.property.ProductVersion)", result.Value); |
50 | Assert.False(result.UpdatedValue); | 51 | Assert.False(result.UpdatedValue); |
51 | Assert.True(result.DelayedResolve); | 52 | Assert.True(result.DelayedResolve); |
52 | 53 | ||
@@ -54,20 +55,20 @@ namespace WixToolsetTest.CoreIntegration | |||
54 | Assert.Throws<WixException>(() => variableResolver.ResolveVariables(null, withUnknownLocString)); | 55 | Assert.Throws<WixException>(() => variableResolver.ResolveVariables(null, withUnknownLocString)); |
55 | 56 | ||
56 | result = variableResolver.ResolveVariables(null, withUnknownLocString, errorOnUnknown: false); | 57 | result = variableResolver.ResolveVariables(null, withUnknownLocString, errorOnUnknown: false); |
57 | Assert.Equal(withUnknownLocString, result.Value); | 58 | WixAssert.StringEqual(withUnknownLocString, result.Value); |
58 | Assert.False(result.UpdatedValue); | 59 | Assert.False(result.UpdatedValue); |
59 | 60 | ||
60 | result = variableResolver.ResolveVariables(null, "Welcome to !!(loc.UnknownLocalizationVariable)"); | 61 | result = variableResolver.ResolveVariables(null, "Welcome to !!(loc.UnknownLocalizationVariable)"); |
61 | Assert.Equal("Welcome to !(loc.UnknownLocalizationVariable)", result.Value); | 62 | WixAssert.StringEqual("Welcome to !(loc.UnknownLocalizationVariable)", result.Value); |
62 | Assert.True(result.UpdatedValue); | 63 | Assert.True(result.UpdatedValue); |
63 | 64 | ||
64 | result = variableResolver.ResolveVariables(null, "Welcome to !!(loc.UnknownLocalizationVariable) v!(bind.property.ProductVersion)"); | 65 | result = variableResolver.ResolveVariables(null, "Welcome to !!(loc.UnknownLocalizationVariable) v!(bind.property.ProductVersion)"); |
65 | Assert.Equal("Welcome to !(loc.UnknownLocalizationVariable) v!(bind.property.ProductVersion)", result.Value); | 66 | WixAssert.StringEqual("Welcome to !(loc.UnknownLocalizationVariable) v!(bind.property.ProductVersion)", result.Value); |
66 | Assert.True(result.UpdatedValue); | 67 | Assert.True(result.UpdatedValue); |
67 | Assert.True(result.DelayedResolve); | 68 | Assert.True(result.DelayedResolve); |
68 | 69 | ||
69 | result = variableResolver.ResolveVariables(null, "Welcome to !(loc.ProductNameEditionVersion) !!(loc.UnknownLocalizationVariable) v!(bind.property.ProductVersion)"); | 70 | result = variableResolver.ResolveVariables(null, "Welcome to !(loc.ProductNameEditionVersion) !!(loc.UnknownLocalizationVariable) v!(bind.property.ProductVersion)"); |
70 | Assert.Equal("Welcome to Localized Product Name Enterprise Edition v1.2.3 !(loc.UnknownLocalizationVariable) v!(bind.property.ProductVersion)", result.Value); | 71 | WixAssert.StringEqual("Welcome to Localized Product Name Enterprise Edition v1.2.3 !(loc.UnknownLocalizationVariable) v!(bind.property.ProductVersion)", result.Value); |
71 | Assert.True(result.UpdatedValue); | 72 | Assert.True(result.UpdatedValue); |
72 | Assert.True(result.DelayedResolve); | 73 | Assert.True(result.DelayedResolve); |
73 | } | 74 | } |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/VersionFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/VersionFixture.cs index c3758c7e..2a325aa4 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/VersionFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/VersionFixture.cs | |||
@@ -33,8 +33,13 @@ namespace WixToolsetTest.CoreIntegration | |||
33 | "-o", msiPath | 33 | "-o", msiPath |
34 | }); | 34 | }); |
35 | 35 | ||
36 | var message = result.Messages.Single(m => m.Level == MessageLevel.Error); | 36 | var errorMessages = result.Messages.Where(m => m.Level == MessageLevel.Error) |
37 | Assert.Equal("Invalid product version '257.0.0'. Product version must have a major version less than 256, a minor version less than 256, and a build version less than 65536.", message.ToString()); | 37 | .Select(m => m.ToString()) |
38 | .ToArray(); | ||
39 | WixAssert.CompareLineByLine(new[] | ||
40 | { | ||
41 | "Invalid product version '257.0.0'. Product version must have a major version less than 256, a minor version less than 256, and a build version less than 65536.", | ||
42 | }, errorMessages); | ||
38 | Assert.Equal(242, result.ExitCode); | 43 | Assert.Equal(242, result.ExitCode); |
39 | } | 44 | } |
40 | } | 45 | } |
@@ -79,7 +84,7 @@ namespace WixToolsetTest.CoreIntegration | |||
79 | 84 | ||
80 | var propertyTable = Query.QueryDatabase(msiPath, new[] { "Property" }).Select(r => r.Split('\t')).ToDictionary(r => r[0].Substring("Property:".Length), r => r[1]); | 85 | var propertyTable = Query.QueryDatabase(msiPath, new[] { "Property" }).Select(r => r.Split('\t')).ToDictionary(r => r[0].Substring("Property:".Length), r => r[1]); |
81 | Assert.True(propertyTable.TryGetValue("ProductVersion", out var productVersion)); | 86 | Assert.True(propertyTable.TryGetValue("ProductVersion", out var productVersion)); |
82 | Assert.Equal("255.255.65535", productVersion); | 87 | WixAssert.StringEqual("255.255.65535", productVersion); |
83 | 88 | ||
84 | var extractResult = BundleExtractor.ExtractAllContainers(null, bundlePath, Path.Combine(baseFolder, "ba"), Path.Combine(baseFolder, "attached"), Path.Combine(baseFolder, "extract")); | 89 | var extractResult = BundleExtractor.ExtractAllContainers(null, bundlePath, Path.Combine(baseFolder, "ba"), Path.Combine(baseFolder, "attached"), Path.Combine(baseFolder, "extract")); |
85 | extractResult.AssertSuccess(); | 90 | extractResult.AssertSuccess(); |
@@ -87,7 +92,7 @@ namespace WixToolsetTest.CoreIntegration | |||
87 | var bundleVersion = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Registration/@Version") | 92 | var bundleVersion = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Registration/@Version") |
88 | .Cast<XmlAttribute>() | 93 | .Cast<XmlAttribute>() |
89 | .Single(); | 94 | .Single(); |
90 | Assert.Equal("2022.3.9-preview.0-build.5+0987654321abcdef1234567890", bundleVersion.Value); | 95 | WixAssert.StringEqual("2022.3.9-preview.0-build.5+0987654321abcdef1234567890", bundleVersion.Value); |
91 | } | 96 | } |
92 | } | 97 | } |
93 | } | 98 | } |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/WixiplFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/WixiplFixture.cs index 942f253f..2d72dcbd 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/WixiplFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/WixiplFixture.cs | |||
@@ -63,8 +63,8 @@ namespace WixToolsetTest.CoreIntegration | |||
63 | var section = intermediate.Sections.Single(); | 63 | var section = intermediate.Sections.Single(); |
64 | 64 | ||
65 | var fileSymbol = section.Symbols.OfType<FileSymbol>().First(); | 65 | var fileSymbol = section.Symbols.OfType<FileSymbol>().First(); |
66 | Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path); | 66 | WixAssert.StringEqual(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path); |
67 | Assert.Equal(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); | 67 | WixAssert.StringEqual(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); |
68 | } | 68 | } |
69 | } | 69 | } |
70 | 70 | ||
@@ -133,8 +133,8 @@ namespace WixToolsetTest.CoreIntegration | |||
133 | 133 | ||
134 | { | 134 | { |
135 | var fileSymbol = section.Symbols.OfType<FileSymbol>().Single(); | 135 | var fileSymbol = section.Symbols.OfType<FileSymbol>().Single(); |
136 | Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path); | 136 | WixAssert.StringEqual(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path); |
137 | Assert.Equal(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); | 137 | WixAssert.StringEqual(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); |
138 | } | 138 | } |
139 | 139 | ||
140 | { | 140 | { |
@@ -142,7 +142,7 @@ namespace WixToolsetTest.CoreIntegration | |||
142 | var path = binary[BinarySymbolFields.Data].AsPath().Path; | 142 | var path = binary[BinarySymbolFields.Data].AsPath().Path; |
143 | Assert.StartsWith(Path.Combine(baseFolder, @"obj\Example.Extension"), path); | 143 | Assert.StartsWith(Path.Combine(baseFolder, @"obj\Example.Extension"), path); |
144 | Assert.EndsWith(@"wix-ir\example.txt", path); | 144 | Assert.EndsWith(@"wix-ir\example.txt", path); |
145 | Assert.Equal(@"BinFromWir", binary.Id.Id); | 145 | WixAssert.StringEqual(@"BinFromWir", binary.Id.Id); |
146 | } | 146 | } |
147 | } | 147 | } |
148 | } | 148 | } |
@@ -188,8 +188,8 @@ namespace WixToolsetTest.CoreIntegration | |||
188 | 188 | ||
189 | { | 189 | { |
190 | var fileSymbol = section.Symbols.OfType<FileSymbol>().Single(); | 190 | var fileSymbol = section.Symbols.OfType<FileSymbol>().Single(); |
191 | Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path); | 191 | WixAssert.StringEqual(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path); |
192 | Assert.Equal(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); | 192 | WixAssert.StringEqual(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); |
193 | } | 193 | } |
194 | 194 | ||
195 | { | 195 | { |
@@ -197,7 +197,7 @@ namespace WixToolsetTest.CoreIntegration | |||
197 | var path = binary[BinarySymbolFields.Data].AsPath().Path; | 197 | var path = binary[BinarySymbolFields.Data].AsPath().Path; |
198 | Assert.StartsWith(Path.Combine(baseFolder, @"obj\test"), path); | 198 | Assert.StartsWith(Path.Combine(baseFolder, @"obj\test"), path); |
199 | Assert.EndsWith(@"wix-ir\example.txt", path); | 199 | Assert.EndsWith(@"wix-ir\example.txt", path); |
200 | Assert.Equal(@"BinFromWir", binary.Id.Id); | 200 | WixAssert.StringEqual(@"BinFromWir", binary.Id.Id); |
201 | } | 201 | } |
202 | } | 202 | } |
203 | } | 203 | } |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/WixlibFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/WixlibFixture.cs index 184b291b..484e5dc1 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/WixlibFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/WixlibFixture.cs | |||
@@ -182,8 +182,8 @@ namespace WixToolsetTest.CoreIntegration | |||
182 | var section = intermediate.Sections.Single(); | 182 | var section = intermediate.Sections.Single(); |
183 | 183 | ||
184 | var wixFile = section.Symbols.OfType<FileSymbol>().First(); | 184 | var wixFile = section.Symbols.OfType<FileSymbol>().First(); |
185 | Assert.Equal(Path.Combine(folder, @"data\test.txt"), wixFile[FileSymbolFields.Source].AsPath().Path); | 185 | WixAssert.StringEqual(Path.Combine(folder, @"data\test.txt"), wixFile[FileSymbolFields.Source].AsPath().Path); |
186 | Assert.Equal(@"test.txt", wixFile[FileSymbolFields.Source].PreviousValue.AsPath().Path); | 186 | WixAssert.StringEqual(@"test.txt", wixFile[FileSymbolFields.Source].PreviousValue.AsPath().Path); |
187 | } | 187 | } |
188 | } | 188 | } |
189 | 189 | ||
@@ -240,7 +240,7 @@ namespace WixToolsetTest.CoreIntegration | |||
240 | var section = intermediate.Sections.Single(); | 240 | var section = intermediate.Sections.Single(); |
241 | 241 | ||
242 | var wixFile = section.Symbols.OfType<BinarySymbol>().First(); | 242 | var wixFile = section.Symbols.OfType<BinarySymbol>().First(); |
243 | Assert.Equal(Path.Combine(folder, @"data\test2.txt"), wixFile.Data.Path); | 243 | WixAssert.StringEqual(Path.Combine(folder, @"data\test2.txt"), wixFile.Data.Path); |
244 | } | 244 | } |
245 | } | 245 | } |
246 | 246 | ||
@@ -284,12 +284,12 @@ namespace WixToolsetTest.CoreIntegration | |||
284 | var section = intermediate.Sections.Single(); | 284 | var section = intermediate.Sections.Single(); |
285 | 285 | ||
286 | var fileSymbol = section.Symbols.OfType<FileSymbol>().Single(); | 286 | var fileSymbol = section.Symbols.OfType<FileSymbol>().Single(); |
287 | Assert.Equal(Path.Combine(folder, @"data\example.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path); | 287 | WixAssert.StringEqual(Path.Combine(folder, @"data\example.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path); |
288 | Assert.Equal(@"example.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); | 288 | WixAssert.StringEqual(@"example.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); |
289 | 289 | ||
290 | var example = section.Symbols.Where(t => t.Definition.Type == SymbolDefinitionType.MustBeFromAnExtension).Single(); | 290 | var example = section.Symbols.Where(t => t.Definition.Type == SymbolDefinitionType.MustBeFromAnExtension).Single(); |
291 | Assert.Equal("Foo", example.Id?.Id); | 291 | WixAssert.StringEqual("Foo", example.Id?.Id); |
292 | Assert.Equal("Bar", example[1].AsString()); | 292 | WixAssert.StringEqual("Bar", example[1].AsString()); |
293 | } | 293 | } |
294 | } | 294 | } |
295 | 295 | ||
@@ -345,13 +345,13 @@ namespace WixToolsetTest.CoreIntegration | |||
345 | var section = intermediate.Sections.Single(); | 345 | var section = intermediate.Sections.Single(); |
346 | 346 | ||
347 | var fileSymbols = section.Symbols.OfType<FileSymbol>().OrderBy(t => Path.GetFileName(t.Source.Path)).ToArray(); | 347 | var fileSymbols = section.Symbols.OfType<FileSymbol>().OrderBy(t => Path.GetFileName(t.Source.Path)).ToArray(); |
348 | Assert.Equal(Path.Combine(folder, @"data\example.txt"), fileSymbols[0][FileSymbolFields.Source].AsPath().Path); | 348 | WixAssert.StringEqual(Path.Combine(folder, @"data\example.txt"), fileSymbols[0][FileSymbolFields.Source].AsPath().Path); |
349 | Assert.Equal(@"example.txt", fileSymbols[0][FileSymbolFields.Source].PreviousValue.AsPath().Path); | 349 | WixAssert.StringEqual(@"example.txt", fileSymbols[0][FileSymbolFields.Source].PreviousValue.AsPath().Path); |
350 | Assert.Equal(Path.Combine(folder, @"data\other.txt"), fileSymbols[1][FileSymbolFields.Source].AsPath().Path); | 350 | WixAssert.StringEqual(Path.Combine(folder, @"data\other.txt"), fileSymbols[1][FileSymbolFields.Source].AsPath().Path); |
351 | Assert.Equal(@"other.txt", fileSymbols[1][FileSymbolFields.Source].PreviousValue.AsPath().Path); | 351 | WixAssert.StringEqual(@"other.txt", fileSymbols[1][FileSymbolFields.Source].PreviousValue.AsPath().Path); |
352 | 352 | ||
353 | var examples = section.Symbols.Where(t => t.Definition.Type == SymbolDefinitionType.MustBeFromAnExtension).ToArray(); | 353 | var examples = section.Symbols.Where(t => t.Definition.Type == SymbolDefinitionType.MustBeFromAnExtension).ToArray(); |
354 | WixAssert.CompareLineByLine(new string[] { "Foo", "Other" }, examples.Select(t => t.Id?.Id).ToArray()); | 354 | WixAssert.CompareLineByLine(new[] { "Foo", "Other" }, examples.Select(t => t.Id?.Id).ToArray()); |
355 | WixAssert.CompareLineByLine(new[] { "filF5_pLhBuF5b4N9XEo52g_hUM5Lo", "filvxdStJhRE_M5kbpLsTZJXbs34Sg" }, examples.Select(t => t[0].AsString()).ToArray()); | 355 | WixAssert.CompareLineByLine(new[] { "filF5_pLhBuF5b4N9XEo52g_hUM5Lo", "filvxdStJhRE_M5kbpLsTZJXbs34Sg" }, examples.Select(t => t[0].AsString()).ToArray()); |
356 | WixAssert.CompareLineByLine(new[] { "Bar", "Value" }, examples.Select(t => t[1].AsString()).ToArray()); | 356 | WixAssert.CompareLineByLine(new[] { "Bar", "Value" }, examples.Select(t => t[1].AsString()).ToArray()); |
357 | } | 357 | } |
diff --git a/src/wix/test/WixToolsetTest.Sdk/MsbuildFixture.cs b/src/wix/test/WixToolsetTest.Sdk/MsbuildFixture.cs index 0f7f8a88..f9a13312 100644 --- a/src/wix/test/WixToolsetTest.Sdk/MsbuildFixture.cs +++ b/src/wix/test/WixToolsetTest.Sdk/MsbuildFixture.cs | |||
@@ -399,7 +399,7 @@ namespace WixToolsetTest.Sdk | |||
399 | var path = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) | 399 | var path = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) |
400 | .Select(s => s.Substring(baseFolder.Length + 1)) | 400 | .Select(s => s.Substring(baseFolder.Length + 1)) |
401 | .Single(); | 401 | .Single(); |
402 | Assert.Equal(@"bin\x86\Release\MsiPackage.wixipl", path); | 402 | WixAssert.StringEqual(@"bin\x86\Release\MsiPackage.wixipl", path); |
403 | } | 403 | } |
404 | } | 404 | } |
405 | 405 | ||
diff --git a/src/wix/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs b/src/wix/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs index cb14bc43..f1fa2453 100644 --- a/src/wix/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs +++ b/src/wix/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs | |||
@@ -66,7 +66,7 @@ namespace WixToolsetTest.Sdk | |||
66 | var section = intermediate.Sections.Single(); | 66 | var section = intermediate.Sections.Single(); |
67 | 67 | ||
68 | var fileSymbol = section.Symbols.OfType<FileSymbol>().Single(); | 68 | var fileSymbol = section.Symbols.OfType<FileSymbol>().Single(); |
69 | Assert.Equal(@"SourceDir\HeatFilePackage.wixproj", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath()?.Path); | 69 | WixAssert.StringEqual(@"SourceDir\HeatFilePackage.wixproj", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath()?.Path); |
70 | } | 70 | } |
71 | } | 71 | } |
72 | 72 | ||
@@ -142,8 +142,8 @@ namespace WixToolsetTest.Sdk | |||
142 | var section = intermediate.Sections.Single(); | 142 | var section = intermediate.Sections.Single(); |
143 | 143 | ||
144 | var fileSymbols = section.Symbols.OfType<FileSymbol>().ToArray(); | 144 | var fileSymbols = section.Symbols.OfType<FileSymbol>().ToArray(); |
145 | Assert.Equal(@"SourceDir\MyProgram.txt", fileSymbols[0][FileSymbolFields.Source].PreviousValue.AsPath()?.Path); | 145 | WixAssert.StringEqual(@"SourceDir\MyProgram.txt", fileSymbols[0][FileSymbolFields.Source].PreviousValue.AsPath()?.Path); |
146 | Assert.Equal(@"SourceDir\MyProgram.json", fileSymbols[1][FileSymbolFields.Source].PreviousValue.AsPath()?.Path); | 146 | WixAssert.StringEqual(@"SourceDir\MyProgram.json", fileSymbols[1][FileSymbolFields.Source].PreviousValue.AsPath()?.Path); |
147 | } | 147 | } |
148 | } | 148 | } |
149 | 149 | ||