Use WixAssert in more places.
Sean Hall committed
Jun 15, 2022 at 17:07 UTC
09501680d4fcef277b33200c702ce409e9f9c1ef
47 files changed
+605
-539
src/api/wix/test/WixToolsetTest.Data/WindowsInstallerTableDefinitionsFixture.cs
+2
-1
@@ -2,6 +2,7 @@
2
3
namespace WixToolsetTest.Data
4
{
5
+ using WixBuildTools.TestSupport;
6
using WixToolset.Data.WindowsInstaller;
7
using Xunit;
8
@@ -21,7 +22,7 @@ namespace WixToolsetTest.Data
22
Assert.Equal(expectedRowType, rowFromTableDefinition.GetType());
23
if (typeof(Row) != expectedRowType)
24
{
24
- Assert.Equal(expectedRowTypeName, expectedRowType.Name);
25
+ WixAssert.StringEqual(expectedRowTypeName, expectedRowType.Name);
26
}
27
}
28
}
src/ext/Bal/test/WixToolsetTest.Bal/BalExtensionFixture.cs
+16
-10
@@ -41,9 +41,11 @@ namespace WixToolsetTest.Bal
41
var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFile, baFolderPath, extractFolderPath);
42
extractResult.AssertSuccess();
43
44
- var balPackageInfos = extractResult.SelectBADataNodes("/ba:BootstrapperApplicationData/ba:WixBalPackageInfo");
45
- var balPackageInfo = (XmlNode)Assert.Single(balPackageInfos);
46
- Assert.Equal("<WixBalPackageInfo PackageId='test.msi' DisplayInternalUICondition='1' />", balPackageInfo.GetTestXml());
44
+ var balPackageInfos = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixBalPackageInfo");
45
+ WixAssert.CompareLineByLine(new string[]
46
+ {
47
+ "<WixBalPackageInfo PackageId='test.msi' DisplayInternalUICondition='1' />",
48
+ }, balPackageInfos);
49
50
Assert.True(File.Exists(Path.Combine(baFolderPath, "thm.wxl")));
51
}
@@ -76,9 +78,11 @@ namespace WixToolsetTest.Bal
78
var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFile, baFolderPath, extractFolderPath);
79
extractResult.AssertSuccess();
80
79
- var balOverridableVariables = extractResult.SelectBADataNodes("/ba:BootstrapperApplicationData/ba:WixStdbaOverridableVariable");
80
- var balOverridableVariable = (XmlNode)Assert.Single(balOverridableVariables);
81
- Assert.Equal("<WixStdbaOverridableVariable Name='TEST1' />", balOverridableVariable.GetTestXml());
81
+ var balOverridableVariables = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixStdbaOverridableVariable");
82
+ WixAssert.CompareLineByLine(new[]
83
+ {
84
+ "<WixStdbaOverridableVariable Name='TEST1' />",
85
+ }, balOverridableVariables);
86
}
87
}
88
@@ -134,9 +138,11 @@ namespace WixToolsetTest.Bal
138
var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFile, baFolderPath, extractFolderPath);
139
extractResult.AssertSuccess();
140
137
- var wixMbaPrereqOptionsElements = extractResult.SelectBADataNodes("/ba:BootstrapperApplicationData/ba:WixMbaPrereqOptions");
138
- var wixMbaPrereqOptions = (XmlNode)Assert.Single(wixMbaPrereqOptionsElements);
139
- Assert.Equal("<WixMbaPrereqOptions AlwaysInstallPrereqs='1' />", wixMbaPrereqOptions.GetTestXml());
141
+ var wixMbaPrereqOptionsElements = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixMbaPrereqOptions");
142
+ WixAssert.CompareLineByLine(new[]
143
+ {
144
+ "<WixMbaPrereqOptions AlwaysInstallPrereqs='1' />",
145
+ }, wixMbaPrereqOptionsElements);
146
}
147
}
148
@@ -159,7 +165,7 @@ namespace WixToolsetTest.Bal
165
"-o", bundleFile,
166
});
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());
169
170
Assert.False(File.Exists(bundleFile));
171
Assert.False(File.Exists(Path.Combine(intermediateFolder, "test.exe")));
src/wix/WixToolset.Core.TestPackage/ExtractBAContainerResult.cs
+34
@@ -2,6 +2,7 @@
2
3
namespace WixToolset.Core.TestPackage
4
{
5
+ using System.Collections.Generic;
6
using System.IO;
7
using System.Xml;
8
using Xunit;
@@ -99,6 +100,17 @@ namespace WixToolset.Core.TestPackage
100
return this.BADataDocument.SelectNodes(xpath, this.BADataNamespaceManager);
101
}
102
103
+ /// <summary>
104
+ ///
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>
@@ -109,6 +121,17 @@ namespace WixToolset.Core.TestPackage
121
return this.BundleExtensionDataDocument.SelectNodes(xpath, this.BundleExtensionDataNamespaceManager);
122
}
123
124
+ /// <summary>
125
+ ///
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>
@@ -118,5 +141,16 @@ namespace WixToolset.Core.TestPackage
141
{
142
return this.ManifestDocument.SelectNodes(xpath, this.ManifestNamespaceManager);
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
+ }
155
}
156
}
src/wix/WixToolset.Core.TestPackage/XmlNodeExtensions.cs
+14
@@ -4,6 +4,7 @@ namespace WixToolset.Core.TestPackage
4
{
5
using System.Collections.Generic;
6
using System.IO;
7
+ using System.Linq;
8
using System.Text.RegularExpressions;
9
using System.Xml;
10
@@ -61,6 +62,19 @@ namespace WixToolset.Core.TestPackage
62
return Regex.Replace(formattedXml, " xmlns(:[^=]+)?='[^']*'", "");
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
+
78
private static void HandleIgnoredAttributes(XmlNode node, Dictionary<string, List<string>> ignoredAttributesByElementName)
79
{
80
if (node.Attributes != null && ignoredAttributesByElementName.TryGetValue(node.LocalName, out var ignoredAttributes))
src/wix/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs
+2
-2
@@ -59,8 +59,8 @@ namespace WixToolsetTest.BuildTasks
59
var section = intermediate.Sections.Single();
60
61
var fileSymbol = section.Symbols.OfType<FileSymbol>().Single();
62
- Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path);
63
- Assert.Equal(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path);
62
+ WixAssert.StringEqual(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path);
63
+ WixAssert.StringEqual(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path);
64
}
65
}
66
}
src/wix/test/WixToolsetTest.Converters.Symbolizer/ConvertSymbolsFixture.cs
+3
-3
@@ -63,8 +63,8 @@ namespace WixToolsetTest.Converters.Symbolizer
63
.OrderBy(s => s)
64
.ToArray();
65
66
-#if false
67
- Assert.Equal(wix3Dump, wix4Dump);
66
+#if true
67
+ WixAssert.CompareLineByLine(wix3Dump, wix4Dump);
68
#else // useful when you want to diff the outputs with another diff tool.
69
var wix3TextDump = String.Join(Environment.NewLine, wix3Dump);
70
var wix4TextDump = String.Join(Environment.NewLine, wix4Dump);
@@ -75,7 +75,7 @@ namespace WixToolsetTest.Converters.Symbolizer
75
File.WriteAllText(path3, wix3TextDump);
76
File.WriteAllText(path4, wix4TextDump);
77
78
- Assert.Equal(wix3TextDump, wix4TextDump);
78
+ WixAssert.StringEqual(wix3TextDump, wix4TextDump);
79
#endif
80
}
81
}
src/wix/test/WixToolsetTest.Converters/BaseConverterFixture.cs
-1
@@ -7,7 +7,6 @@ namespace WixToolsetTest.Converters
7
using System.Text;
8
using System.Xml;
9
using System.Xml.Linq;
10
- using Xunit;
10
11
public abstract class BaseConverterFixture
12
{
src/wix/test/WixToolsetTest.Converters/ConverterFixture.cs
+91
-60
@@ -4,6 +4,7 @@ namespace WixToolsetTest.Converters
4
{
5
using System;
6
using System.Xml.Linq;
7
+ using WixBuildTools.TestSupport;
8
using WixToolset.Converters;
9
using WixToolsetTest.Converters.Mocks;
10
using Xunit;
@@ -21,10 +22,12 @@ namespace WixToolsetTest.Converters
22
" <Fragment />",
23
"</Wix>");
24
24
- var expected = String.Join(Environment.NewLine,
25
+ var expected = new[]
26
+ {
27
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
28
" <Fragment />",
27
- "</Wix>");
29
+ "</Wix>",
30
+ };
31
32
var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo);
33
@@ -33,10 +36,10 @@ namespace WixToolsetTest.Converters
36
37
var errors = converter.ConvertDocument(document);
38
36
- var actual = UnformattedDocumentString(document);
39
+ var actual = UnformattedDocumentLines(document);
40
41
Assert.Equal(1, errors);
39
- Assert.Equal(expected, actual);
42
+ WixAssert.CompareLineByLine(expected, actual);
43
}
44
45
[Fact]
@@ -48,11 +51,13 @@ namespace WixToolsetTest.Converters
51
" <Fragment />",
52
"</Wix>");
53
51
- var expected = String.Join(Environment.NewLine,
54
+ var expected = new[]
55
+ {
56
"<?xml version=\"1.0\" encoding=\"utf-16\"?>",
57
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
58
" <Fragment />",
55
- "</Wix>");
59
+ "</Wix>",
60
+ };
61
62
var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo);
63
@@ -61,10 +66,10 @@ namespace WixToolsetTest.Converters
66
67
var errors = converter.ConvertDocument(document);
68
64
- var actual = UnformattedDocumentString(document, omitXmlDeclaration: false);
69
+ var actual = UnformattedDocumentLines(document, omitXmlDeclaration: false);
70
71
Assert.Equal(0, errors);
67
- Assert.Equal(expected, actual);
72
+ WixAssert.CompareLineByLine(expected, actual);
73
}
74
75
[Fact]
@@ -76,10 +81,12 @@ namespace WixToolsetTest.Converters
81
" <Fragment />",
82
"</Wix>");
83
79
- var expected = String.Join(Environment.NewLine,
84
+ var expected = new[]
85
+ {
86
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
87
" <Fragment />",
82
- "</Wix>");
88
+ "</Wix>",
89
+ };
90
91
var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo);
92
@@ -88,11 +95,11 @@ namespace WixToolsetTest.Converters
95
96
var errors = converter.ConvertDocument(document);
97
91
- var actual = UnformattedDocumentString(document);
98
+ var actual = UnformattedDocumentLines(document);
99
100
Assert.Equal(2, errors);
101
//Assert.Equal(Wix4Namespace, document.Root.GetDefaultNamespace());
95
- Assert.Equal(expected, actual);
102
+ WixAssert.CompareLineByLine(expected, actual);
103
}
104
105
[Fact]
@@ -104,10 +111,12 @@ namespace WixToolsetTest.Converters
111
" <w:Fragment />",
112
"</w:Wix>");
113
107
- var expected = String.Join(Environment.NewLine,
114
+ var expected = new[]
115
+ {
116
"<w:Wix xmlns:w=\"http://wixtoolset.org/schemas/v4/wxs\">",
117
" <w:Fragment />",
110
- "</w:Wix>");
118
+ "</w:Wix>",
119
+ };
120
121
var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo);
122
@@ -116,10 +125,10 @@ namespace WixToolsetTest.Converters
125
126
var errors = converter.ConvertDocument(document);
127
119
- var actual = UnformattedDocumentString(document);
128
+ var actual = UnformattedDocumentLines(document);
129
130
Assert.Equal(2, errors);
122
- Assert.Equal(expected, actual);
131
+ WixAssert.CompareLineByLine(expected, actual);
132
Assert.Equal(Wix4Namespace, document.Root.GetNamespaceOfPrefix("w"));
133
}
134
@@ -134,12 +143,14 @@ namespace WixToolsetTest.Converters
143
" </w:Fragment>",
144
"</w:Wix>");
145
137
- var expected = String.Join(Environment.NewLine,
146
+ var expected = new[]
147
+ {
148
"<w:Wix xmlns:w=\"http://wixtoolset.org/schemas/v4/wxs\" xmlns=\"http://wixtoolset.org/schemas/v4/wxs/util\">",
149
" <w:Fragment>",
150
" <Test />",
151
" </w:Fragment>",
142
- "</w:Wix>");
152
+ "</w:Wix>",
153
+ };
154
155
var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo);
156
@@ -148,9 +159,9 @@ namespace WixToolsetTest.Converters
159
160
var errors = converter.ConvertDocument(document);
161
151
- var actual = UnformattedDocumentString(document);
162
+ var actual = UnformattedDocumentLines(document);
163
153
- Assert.Equal(expected, actual);
164
+ WixAssert.CompareLineByLine(expected, actual);
165
Assert.Equal(3, errors);
166
Assert.Equal(Wix4Namespace, document.Root.GetNamespaceOfPrefix("w"));
167
Assert.Equal("http://wixtoolset.org/schemas/v4/wxs/util", document.Root.GetDefaultNamespace());
@@ -165,10 +176,12 @@ namespace WixToolsetTest.Converters
176
" <Fragment />",
177
"</Wix>");
178
168
- var expected = String.Join(Environment.NewLine,
179
+ var expected = new[]
180
+ {
181
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
182
" <Fragment />",
171
- "</Wix>");
183
+ "</Wix>",
184
+ };
185
186
var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo);
187
@@ -177,10 +190,10 @@ namespace WixToolsetTest.Converters
190
191
var errors = converter.ConvertDocument(document);
192
180
- var actual = UnformattedDocumentString(document);
193
+ var actual = UnformattedDocumentLines(document);
194
195
Assert.Equal(4, errors);
183
- Assert.Equal(expected, actual);
196
+ WixAssert.CompareLineByLine(expected, actual);
197
Assert.Equal(Wix4Namespace, document.Root.GetDefaultNamespace());
198
}
199
@@ -193,10 +206,12 @@ namespace WixToolsetTest.Converters
206
" <Fragment />",
207
"</Wix>");
208
196
- var expected = String.Join(Environment.NewLine,
209
+ var expected = new[]
210
+ {
211
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
212
" <Fragment />",
199
- "</Wix>");
213
+ "</Wix>",
214
+ };
215
216
var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo);
217
@@ -205,10 +220,10 @@ namespace WixToolsetTest.Converters
220
221
var errors = converter.ConvertDocument(document);
222
208
- var actual = UnformattedDocumentString(document);
223
+ var actual = UnformattedDocumentLines(document);
224
225
Assert.Equal(2, errors);
211
- Assert.Equal(expected, actual);
226
+ WixAssert.CompareLineByLine(expected, actual);
227
Assert.Equal(Wix4Namespace, document.Root.GetDefaultNamespace());
228
}
229
@@ -226,7 +241,8 @@ namespace WixToolsetTest.Converters
241
" </Fragment>",
242
"</Include>");
243
229
- var expected = String.Join(Environment.NewLine,
244
+ var expected = new[]
245
+ {
246
"<Include xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
247
" <?define Version = 1.2.3 ?>",
248
" <Fragment>",
@@ -234,7 +250,8 @@ namespace WixToolsetTest.Converters
250
" <Directory Id=\"ANOTHERDIR\" Name=\"Another\" />",
251
" </DirectoryRef>",
252
" </Fragment>",
237
- "</Include>");
253
+ "</Include>",
254
+ };
255
256
var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo);
257
@@ -243,10 +260,10 @@ namespace WixToolsetTest.Converters
260
261
var errors = converter.ConvertDocument(document);
262
246
- var actual = UnformattedDocumentString(document);
263
+ var actual = UnformattedDocumentLines(document);
264
265
Assert.Equal(2, errors);
249
- Assert.Equal(expected, actual);
266
+ WixAssert.CompareLineByLine(expected, actual);
267
Assert.Equal(Wix4Namespace, document.Root.GetDefaultNamespace());
268
}
269
@@ -259,10 +276,12 @@ namespace WixToolsetTest.Converters
276
" <File Source='path\\to\\foo.txt' />",
277
"</Wix>");
278
262
- var expected = String.Join(Environment.NewLine,
279
+ var expected = new[]
280
+ {
281
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
282
" <File Id=\"foo.txt\" Source=\"path\\to\\foo.txt\" />",
265
- "</Wix>");
283
+ "</Wix>",
284
+ };
285
286
var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo);
287
@@ -271,10 +290,10 @@ namespace WixToolsetTest.Converters
290
291
var errors = converter.ConvertDocument(document);
292
274
- var actual = UnformattedDocumentString(document);
293
+ var actual = UnformattedDocumentLines(document);
294
295
Assert.Equal(3, errors);
277
- Assert.Equal(expected, actual);
296
+ WixAssert.CompareLineByLine(expected, actual);
297
}
298
299
[Fact]
@@ -286,10 +305,12 @@ namespace WixToolsetTest.Converters
305
" <Directory ShortName='iamshort' />",
306
"</Wix>");
307
289
- var expected = String.Join(Environment.NewLine,
308
+ var expected = new[]
309
+ {
310
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
311
" <Directory Name=\"iamshort\" />",
292
- "</Wix>");
312
+ "</Wix>",
313
+ };
314
315
var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo);
316
@@ -298,10 +319,10 @@ namespace WixToolsetTest.Converters
319
320
var errors = converter.ConvertDocument(document);
321
301
- var actual = UnformattedDocumentString(document);
322
+ var actual = UnformattedDocumentLines(document);
323
324
Assert.Equal(2, errors);
304
- Assert.Equal(expected, actual);
325
+ WixAssert.CompareLineByLine(expected, actual);
326
}
327
328
[Fact]
@@ -312,10 +333,12 @@ namespace WixToolsetTest.Converters
333
" <Catalog Id='idCatalog' SourceFile='path\\to\\catalog.cat' />",
334
"</Wix>");
335
315
- var expected = String.Join(Environment.NewLine,
336
+ var expected = new[]
337
+ {
338
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
339
" ",
318
- "</Wix>");
340
+ "</Wix>",
341
+ };
342
343
var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo);
344
@@ -324,10 +347,10 @@ namespace WixToolsetTest.Converters
347
348
var errors = converter.ConvertDocument(document);
349
327
- var actual = UnformattedDocumentString(document);
350
+ var actual = UnformattedDocumentLines(document);
351
352
Assert.Equal(1, errors);
330
- Assert.Equal(expected, actual);
353
+ WixAssert.CompareLineByLine(expected, actual);
354
}
355
356
[Fact]
@@ -338,10 +361,12 @@ namespace WixToolsetTest.Converters
361
" <MsiPackage SuppressSignatureValidation='no' />",
362
"</Wix>");
363
341
- var expected = String.Join(Environment.NewLine,
364
+ var expected = new[]
365
+ {
366
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
367
" <MsiPackage />",
344
- "</Wix>");
368
+ "</Wix>",
369
+ };
370
371
var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo);
372
@@ -350,10 +375,10 @@ namespace WixToolsetTest.Converters
375
376
var errors = converter.ConvertDocument(document);
377
353
- var actual = UnformattedDocumentString(document);
378
+ var actual = UnformattedDocumentLines(document);
379
380
Assert.Equal(1, errors);
356
- Assert.Equal(expected, actual);
381
+ WixAssert.CompareLineByLine(expected, actual);
382
}
383
384
[Fact]
@@ -364,10 +389,12 @@ namespace WixToolsetTest.Converters
389
" <Payload SuppressSignatureValidation='yes' />",
390
"</Wix>");
391
367
- var expected = String.Join(Environment.NewLine,
392
+ var expected = new[]
393
+ {
394
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
395
" <Payload />",
370
- "</Wix>");
396
+ "</Wix>",
397
+ };
398
399
var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo);
400
@@ -376,10 +403,10 @@ namespace WixToolsetTest.Converters
403
404
var errors = converter.ConvertDocument(document);
405
379
- var actual = UnformattedDocumentString(document);
406
+ var actual = UnformattedDocumentLines(document);
407
408
Assert.Equal(1, errors);
382
- Assert.Equal(expected, actual);
409
+ WixAssert.CompareLineByLine(expected, actual);
410
}
411
412
[Fact]
@@ -390,10 +417,12 @@ namespace WixToolsetTest.Converters
417
" <Verb Target='anything' />",
418
"</Wix>");
419
393
- var expected = String.Join(Environment.NewLine,
420
+ var expected = new[]
421
+ {
422
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
423
" <Verb Target=\"anything\" />",
396
- "</Wix>");
424
+ "</Wix>",
425
+ };
426
427
var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo);
428
@@ -402,10 +431,10 @@ namespace WixToolsetTest.Converters
431
432
var errors = converter.ConvertDocument(document);
433
405
- var actual = UnformattedDocumentString(document);
434
+ var actual = UnformattedDocumentLines(document);
435
436
Assert.Equal(2, errors);
408
- Assert.Equal(expected, actual);
437
+ WixAssert.CompareLineByLine(expected, actual);
438
}
439
440
[Fact]
@@ -422,7 +451,8 @@ namespace WixToolsetTest.Converters
451
"</Fragment>",
452
"</Wix>");
453
425
- var expected = String.Join(Environment.NewLine,
454
+ var expected = new[]
455
+ {
456
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
457
"<Fragment>",
458
"<ComponentGroup Id=\"!(loc.Variable)\" />",
@@ -431,7 +461,8 @@ namespace WixToolsetTest.Converters
461
"<ComponentGroup Id=\"$$$$(loc.Variable)\" />",
462
"<ComponentGroup Id=\"$$$$!(loc.Variable)\" />",
463
"</Fragment>",
434
- "</Wix>");
464
+ "</Wix>",
465
+ };
466
467
var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo);
468
@@ -440,10 +471,10 @@ namespace WixToolsetTest.Converters
471
472
var errors = converter.ConvertDocument(document);
473
443
- var actual = UnformattedDocumentString(document);
474
+ var actual = UnformattedDocumentLines(document);
475
476
Assert.Equal(3, errors);
446
- Assert.Equal(expected, actual);
477
+ WixAssert.CompareLineByLine(expected, actual);
478
}
479
}
480
}
src/wix/test/WixToolsetTest.Converters/ConverterIntegrationFixture.cs
+5
-5
@@ -35,7 +35,7 @@ namespace WixToolsetTest.Converters
35
36
var expected = File.ReadAllText(Path.Combine(folder, afterFileName)).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
40
EnsureFixed(targetFile);
41
}
@@ -62,7 +62,7 @@ namespace WixToolsetTest.Converters
62
63
var expected = File.ReadAllText(Path.Combine(folder, afterFileName)).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
67
EnsureFixed(targetFile);
68
}
@@ -111,7 +111,7 @@ namespace WixToolsetTest.Converters
111
112
var expected = File.ReadAllText(Path.Combine(folder, afterFileName)).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
116
EnsureFixed(targetFile);
117
}
@@ -135,7 +135,7 @@ namespace WixToolsetTest.Converters
135
136
var expected = File.ReadAllText(Path.Combine(folder, afterFileName)).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
140
EnsureFixed(targetFile);
141
}
@@ -161,7 +161,7 @@ namespace WixToolsetTest.Converters
161
162
var expected = File.ReadAllText(Path.Combine(folder, afterFileName)).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
166
// still fails because QtExecCmdTimeoutAmbiguous is unfixable
167
var result2 = RunConversion(targetFile);
src/wix/test/WixToolsetTest.Converters/CustomActionFixture.cs
+14
-9
@@ -5,6 +5,7 @@ namespace WixToolsetTest.Converters
5
using System;
6
using System.IO;
7
using System.Xml.Linq;
8
+ using WixBuildTools.TestSupport;
9
using WixToolset.Converters;
10
using WixToolsetTest.Converters.Mocks;
11
using Xunit;
@@ -23,13 +24,15 @@ namespace WixToolsetTest.Converters
24
" <CustomAction Id='Foo' BinaryKey='UtilCA_x64' DllEntry='WixQuietExec64' />",
25
"</Wix>");
26
26
- var expected = String.Join(Environment.NewLine,
27
+ var expected = new[]
28
+ {
29
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
30
" <CustomAction Id=\"Foo\" DllEntry=\"WixQuietExec\" BinaryRef=\"Wix4UtilCA_X86\" />",
31
" <CustomAction Id=\"Foo\" DllEntry=\"WixQuietExec64\" BinaryRef=\"Wix4UtilCA_X64\" />",
32
" <CustomAction Id=\"Foo\" DllEntry=\"WixQuietExec\" BinaryRef=\"Wix4UtilCA_X86\" />",
33
" <CustomAction Id=\"Foo\" DllEntry=\"WixQuietExec64\" BinaryRef=\"Wix4UtilCA_X64\" />",
32
- "</Wix>");
34
+ "</Wix>",
35
+ };
36
37
var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo);
38
@@ -38,10 +41,10 @@ namespace WixToolsetTest.Converters
41
42
var errors = converter.ConvertDocument(document);
43
41
- var actual = UnformattedDocumentString(document);
44
+ var actual = UnformattedDocumentLines(document);
45
46
Assert.Equal(11, errors);
44
- Assert.Equal(expected, actual);
47
+ WixAssert.CompareLineByLine(expected, actual);
48
}
49
50
[Fact]
@@ -58,10 +61,12 @@ namespace WixToolsetTest.Converters
61
" </CustomAction>",
62
"</Wix>");
63
61
- var expected = String.Join(Environment.NewLine,
64
+ var expected = new[]
65
+ {
66
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
67
" <CustomAction Id=\"Foo\" Script=\"jscript\" ScriptSourceFile=\"Foo.js\" />",
64
- "</Wix>");
68
+ "</Wix>",
69
+ };
70
71
var expectedScript = String.Join("\n",
72
"function() {",
@@ -76,13 +81,13 @@ namespace WixToolsetTest.Converters
81
82
var errors = converter.ConvertDocument(document);
83
79
- var actual = UnformattedDocumentString(document);
84
+ var actual = UnformattedDocumentLines(document);
85
86
Assert.Equal(2, errors);
82
- Assert.Equal(expected, actual);
87
+ WixAssert.CompareLineByLine(expected, actual);
88
89
var script = File.ReadAllText("Foo.js");
85
- Assert.Equal(expectedScript, script);
90
+ WixAssert.StringEqual(expectedScript, script);
91
}
92
}
93
}
src/wix/test/WixToolsetTest.Converters/CustomTableFixture.cs
+36
-24
@@ -181,7 +181,8 @@ namespace WixToolsetTest.Converters
181
" </CustomTable>",
182
"</Wix>");
183
184
- var expected = String.Join(Environment.NewLine,
184
+ var expected = new[]
185
+ {
186
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
187
" <BundleCustomData Id=\"FgAppx\">",
188
" <BundleAttributeDefinition Id=\"Column1\" />",
@@ -189,7 +190,8 @@ namespace WixToolsetTest.Converters
190
" <BundleAttribute Id=\"Column1\" Value=\"Row1\" />",
191
" </BundleElement>",
192
" </BundleCustomData>",
192
- "</Wix>");
193
+ "</Wix>",
194
+ };
195
196
var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo);
197
@@ -198,10 +200,10 @@ namespace WixToolsetTest.Converters
200
201
var errors = converter.ConvertDocument(document);
202
201
- var actual = UnformattedDocumentString(document);
203
+ var actual = UnformattedDocumentLines(document);
204
205
Assert.Equal(2, errors);
204
- Assert.Equal(expected, actual);
206
+ WixAssert.CompareLineByLine(expected, actual);
207
}
208
209
[Fact]
@@ -216,14 +218,16 @@ namespace WixToolsetTest.Converters
218
" </CustomTable>",
219
"</Wix>");
220
219
- var expected = String.Join(Environment.NewLine,
221
+ var expected = new[]
222
+ {
223
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
224
" <BundleCustomDataRef Id=\"FgAppx\">",
225
" <BundleElement>",
226
" <BundleAttribute Id=\"Column1\" Value=\"Row1\" />",
227
" </BundleElement>",
228
" </BundleCustomDataRef>",
226
- "</Wix>");
229
+ "</Wix>",
230
+ };
231
232
var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo);
233
@@ -232,10 +236,10 @@ namespace WixToolsetTest.Converters
236
237
var errors = converter.ConvertDocument(document);
238
235
- var actual = UnformattedDocumentString(document);
239
+ var actual = UnformattedDocumentLines(document);
240
241
Assert.Equal(2, errors);
238
- Assert.Equal(expected, actual);
242
+ WixAssert.CompareLineByLine(expected, actual);
243
}
244
245
[Fact]
@@ -251,7 +255,8 @@ namespace WixToolsetTest.Converters
255
" </CustomTable>",
256
"</Wix>");
257
254
- var expected = String.Join(Environment.NewLine,
258
+ var expected = new[]
259
+ {
260
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
261
" <CustomTable Id=\"FgAppx\" Unreal=\"yes\">",
262
" <Column Id=\"Column1\" PrimaryKey=\"yes\" Type=\"string\" Width=\"0\" Category=\"text\" Description=\"The first custom column.\" />",
@@ -259,7 +264,8 @@ namespace WixToolsetTest.Converters
264
" <Data Column=\"Column1\" Value=\"Row1\" />",
265
" </Row>",
266
" </CustomTable>",
262
- "</Wix>");
267
+ "</Wix>",
268
+ };
269
270
var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo);
271
@@ -268,10 +274,10 @@ namespace WixToolsetTest.Converters
274
275
var errors = converter.ConvertDocument(document);
276
271
- var actual = UnformattedDocumentString(document);
277
+ var actual = UnformattedDocumentLines(document);
278
279
Assert.Equal(2, errors);
274
- Assert.Equal(expected, actual);
280
+ WixAssert.CompareLineByLine(expected, actual);
281
}
282
283
[Fact]
@@ -286,14 +292,16 @@ namespace WixToolsetTest.Converters
292
" </CustomTable>",
293
"</Wix>");
294
289
- var expected = String.Join(Environment.NewLine,
295
+ var expected = new[]
296
+ {
297
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
298
" <CustomTableRef Id=\"FgAppx\">",
299
" <Row>",
300
" <Data Column=\"Column1\" Value=\"Row1\" />",
301
" </Row>",
302
" </CustomTableRef>",
296
- "</Wix>");
303
+ "</Wix>",
304
+ };
305
306
var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo);
307
@@ -302,10 +310,10 @@ namespace WixToolsetTest.Converters
310
311
var errors = converter.ConvertDocument(document);
312
305
- var actual = UnformattedDocumentString(document);
313
+ var actual = UnformattedDocumentLines(document);
314
315
Assert.Equal(2, errors);
308
- Assert.Equal(expected, actual);
316
+ WixAssert.CompareLineByLine(expected, actual);
317
}
318
319
[Fact]
@@ -316,10 +324,12 @@ namespace WixToolsetTest.Converters
324
" <CustomTable Id='FgAppx' BootstrapperApplicationData='yes' />",
325
"</Wix>");
326
319
- var expected = String.Join(Environment.NewLine,
327
+ var expected = new[]
328
+ {
329
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
330
" <CustomTable Id=\"FgAppx\" BootstrapperApplicationData=\"yes\" />",
322
- "</Wix>");
331
+ "</Wix>",
332
+ };
333
334
var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo);
335
@@ -328,10 +338,10 @@ namespace WixToolsetTest.Converters
338
339
var errors = converter.ConvertDocument(document);
340
331
- var actual = UnformattedDocumentString(document);
341
+ var actual = UnformattedDocumentLines(document);
342
343
Assert.Equal(1, errors);
334
- Assert.Equal(expected, actual);
344
+ WixAssert.CompareLineByLine(expected, actual);
345
}
346
347
[Fact]
@@ -342,10 +352,12 @@ namespace WixToolsetTest.Converters
352
" <CustomTable Id='FgAppx' BootstrapperApplicationData='no' />",
353
"</Wix>");
354
345
- var expected = String.Join(Environment.NewLine,
355
+ var expected = new[]
356
+ {
357
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
358
" <CustomTable Id=\"FgAppx\" />",
348
- "</Wix>");
359
+ "</Wix>",
360
+ };
361
362
var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo);
363
@@ -354,10 +366,10 @@ namespace WixToolsetTest.Converters
366
367
var errors = converter.ConvertDocument(document);
368
357
- var actual = UnformattedDocumentString(document);
369
+ var actual = UnformattedDocumentLines(document);
370
371
Assert.Equal(1, errors);
360
- Assert.Equal(expected, actual);
372
+ WixAssert.CompareLineByLine(expected, actual);
373
}
374
}
375
}
src/wix/test/WixToolsetTest.Converters/PropertyFixture.cs
+19
-12
@@ -4,6 +4,7 @@ namespace WixToolsetTest.Converters
4
{
5
using System;
6
using System.Xml.Linq;
7
+ using WixBuildTools.TestSupport;
8
using WixToolset.Converters;
9
using WixToolsetTest.Converters.Mocks;
10
using Xunit;
@@ -22,12 +23,14 @@ namespace WixToolsetTest.Converters
23
" </Fragment>",
24
"</Wix>");
25
25
- var expected = String.Join(Environment.NewLine,
26
+ var expected = new[]
27
+ {
28
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
29
" <Fragment>",
30
" <Property Id=\"Prop\" Value=\"1<2\" />",
31
" </Fragment>",
30
- "</Wix>");
32
+ "</Wix>",
33
+ };
34
35
var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo);
36
@@ -36,9 +39,9 @@ namespace WixToolsetTest.Converters
39
40
var errors = converter.ConvertDocument(document);
41
39
- var actual = UnformattedDocumentString(document);
42
+ var actual = UnformattedDocumentLines(document);
43
41
- Assert.Equal(expected, actual);
44
+ WixAssert.CompareLineByLine(expected, actual);
45
Assert.Equal(1, errors);
46
}
47
@@ -56,12 +59,14 @@ namespace WixToolsetTest.Converters
59
" </Fragment>",
60
"</Wix>");
61
59
- var expected = String.Join(Environment.NewLine,
62
+ var expected = new[]
63
+ {
64
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
65
" <Fragment>",
66
" <Property Id=\"Prop\" Value=\"1<2\" />",
67
" </Fragment>",
64
- "</Wix>");
68
+ "</Wix>",
69
+ };
70
71
var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo);
72
@@ -70,9 +75,9 @@ namespace WixToolsetTest.Converters
75
76
var errors = converter.ConvertDocument(document);
77
73
- var actual = UnformattedDocumentString(document);
78
+ var actual = UnformattedDocumentLines(document);
79
75
- Assert.Equal(expected, actual);
80
+ WixAssert.CompareLineByLine(expected, actual);
81
Assert.Equal(1, errors);
82
}
83
@@ -86,12 +91,14 @@ namespace WixToolsetTest.Converters
91
" </Fragment>",
92
"</Wix>");
93
89
- var expected = String.Join(Environment.NewLine,
94
+ var expected = new[]
95
+ {
96
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
97
" <Fragment>",
98
" <Property Id=\"Prop\" Value=\" \" />",
99
" </Fragment>",
94
- "</Wix>");
100
+ "</Wix>",
101
+ };
102
103
var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo);
104
@@ -99,9 +106,9 @@ namespace WixToolsetTest.Converters
106
var converter = new WixConverter(messaging, 2, null, null);
107
var errors = converter.ConvertDocument(document);
108
102
- var actual = UnformattedDocumentString(document);
109
+ var actual = UnformattedDocumentLines(document);
110
104
- Assert.Equal(expected, actual);
111
+ WixAssert.CompareLineByLine(expected, actual);
112
Assert.Equal(1, errors);
113
}
114
}
src/wix/test/WixToolsetTest.Core.Native/CabinetFixture.cs
+2
-2
@@ -5,8 +5,8 @@ namespace WixToolsetTest.CoreNative
5
using System.IO;
6
using System.Linq;
7
using WixToolset.Core.Native;
8
- using WixToolsetTest.CoreNative.Utility;
8
using WixToolset.Data;
9
+ using WixToolsetTest.CoreNative.Utility;
10
using Xunit;
11
12
public class CabinetFixture
@@ -85,7 +85,7 @@ namespace WixToolsetTest.CoreNative
85
var cabFileInfo = enumerated[i];
86
var fileInfo = new FileInfo(files[i]);
87
88
- Assert.Equal(cabFileInfo.FileId, fileInfo.Name);
88
+ WixBuildTools.TestSupport.WixAssert.StringEqual(cabFileInfo.FileId, fileInfo.Name);
89
Assert.Equal(cabFileInfo.Size, fileInfo.Length);
90
Assert.True(cabFileInfo.SameAsDateTime(fileInfo.CreationTime));
91
}
src/wix/test/WixToolsetTest.Core.Native/CertificateHashesFixture.cs
+7
-8
@@ -2,7 +2,6 @@
2
3
namespace WixToolsetTest.CoreNative
4
{
5
- using System.ComponentModel;
5
using System.Linq;
6
using WixToolset.Core.Native;
7
using WixToolsetTest.CoreNative.Utility;
@@ -18,9 +17,9 @@ namespace WixToolsetTest.CoreNative
17
var hashes = CertificateHashes.Read(new[] { cabFile });
18
19
var hash = hashes.Single();
21
- Assert.Equal(cabFile, hash.Path);
22
- Assert.Equal("7EC90B3FC3D580EB571210011F1095E149DCC6BB", hash.PublicKey);
23
- Assert.Equal("0B13494DB50BC185A34389BBBAA01EDD1CF56350", hash.Thumbprint);
20
+ WixBuildTools.TestSupport.WixAssert.StringEqual(cabFile, hash.Path);
21
+ WixBuildTools.TestSupport.WixAssert.StringEqual("7EC90B3FC3D580EB571210011F1095E149DCC6BB", hash.PublicKey);
22
+ WixBuildTools.TestSupport.WixAssert.StringEqual("0B13494DB50BC185A34389BBBAA01EDD1CF56350", hash.Thumbprint);
23
Assert.Null(hash.Exception);
24
}
25
@@ -32,7 +31,7 @@ namespace WixToolsetTest.CoreNative
31
var hashes = CertificateHashes.Read(new[] { txtFile });
32
33
var hash = hashes.Single();
35
- Assert.Equal(txtFile, hash.Path);
34
+ WixBuildTools.TestSupport.WixAssert.StringEqual(txtFile, hash.Path);
35
Assert.Null(hash.Exception);
36
}
37
@@ -44,9 +43,9 @@ namespace WixToolsetTest.CoreNative
43
44
var hashes = CertificateHashes.Read(new[] { cabFile, txtFile });
45
47
- Assert.Equal(cabFile, hashes[0].Path);
48
- Assert.Equal("7EC90B3FC3D580EB571210011F1095E149DCC6BB", hashes[0].PublicKey);
49
- Assert.Equal("0B13494DB50BC185A34389BBBAA01EDD1CF56350", hashes[0].Thumbprint);
46
+ WixBuildTools.TestSupport.WixAssert.StringEqual(cabFile, hashes[0].Path);
47
+ WixBuildTools.TestSupport.WixAssert.StringEqual("7EC90B3FC3D580EB571210011F1095E149DCC6BB", hashes[0].PublicKey);
48
+ WixBuildTools.TestSupport.WixAssert.StringEqual("0B13494DB50BC185A34389BBBAA01EDD1CF56350", hashes[0].Thumbprint);
49
Assert.Null(hashes[0].Exception);
50
51
Assert.Equal(txtFile, hashes[1].Path);
src/wix/test/WixToolsetTest.Core.Native/WixToolsetTest.Core.Native.csproj
+4
@@ -18,6 +18,10 @@
18
<ProjectReference Include="..\..\WixToolset.Core.Native\WixToolset.Core.Native.csproj" />
19
</ItemGroup>
20
21
+ <ItemGroup>
22
+ <PackageReference Include="WixBuildTools.TestSupport" />
23
+ </ItemGroup>
24
+
25
<ItemGroup>
26
<PackageReference Include="Microsoft.NET.Test.Sdk" />
27
<PackageReference Include="xunit" />
src/wix/test/WixToolsetTest.Core/ParserHelperFixture.cs
+7
-6
@@ -4,6 +4,7 @@ namespace WixToolsetTest.Core
4
{
5
using System;
6
using System.Xml.Linq;
7
+ using WixBuildTools.TestSupport;
8
using WixToolset.Core;
9
using WixToolset.Data;
10
using WixToolset.Extensibility.Services;
@@ -19,7 +20,7 @@ namespace WixToolsetTest.Core
20
var attribute = CreateAttribute("1.2.3.4");
21
var result = helper.GetAttributeVersionValue(null, attribute);
22
22
- Assert.Equal("1.2.3.4", result);
23
+ WixAssert.StringEqual("1.2.3.4", result);
24
}
25
26
[Fact]
@@ -29,7 +30,7 @@ namespace WixToolsetTest.Core
30
31
var attribute = CreateAttribute("1.2.3.4.5");
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);
34
}
35
36
[Fact]
@@ -44,7 +45,7 @@ namespace WixToolsetTest.Core
45
var helper = GetParserHelper();
46
var attribute = CreateAttribute(version);
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);
49
}
50
51
[Fact]
@@ -55,7 +56,7 @@ namespace WixToolsetTest.Core
56
var attribute = CreateAttribute("10.99.444-preview.0");
57
var result = helper.GetAttributeVersionValue(null, attribute);
58
58
- Assert.Equal("10.99.444-preview.0", result);
59
+ WixAssert.StringEqual("10.99.444-preview.0", result);
60
}
61
62
[Fact]
@@ -66,7 +67,7 @@ namespace WixToolsetTest.Core
67
var attribute = CreateAttribute("1.2.3.4-meta.123-other.456");
68
var result = helper.GetAttributeVersionValue(null, attribute);
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);
71
}
72
73
[Fact]
@@ -77,7 +78,7 @@ namespace WixToolsetTest.Core
78
var attribute = CreateAttribute("v1.2.3.4");
79
var result = helper.GetAttributeVersionValue(null, attribute);
80
80
- Assert.Equal("1.2.3.4", result);
81
+ WixAssert.StringEqual("1.2.3.4", result);
82
}
83
84
src/wix/test/WixToolsetTest.CoreIntegration/BindVariablesFixture.cs
+5
-5
@@ -64,11 +64,11 @@ namespace WixToolsetTest.CoreIntegration
64
result.AssertSuccess();
65
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"]);
68
- Assert.Equal("Property:TestPackageManufacturer\tExample Corporation", queryResults["Property:TestPackageManufacturer"]);
69
- Assert.Equal("Property:TestPackageName\tPacakgeWithBindVariables", queryResults["Property:TestPackageName"]);
70
- Assert.Equal("Property:TestPackageVersion\t3.14.1703.0", queryResults["Property:TestPackageVersion"]);
71
- Assert.Equal("Property:TestTextVersion\tv", queryResults["Property:TestTextVersion"]);
67
+ WixAssert.StringEqual("Property:ProductVersion\t3.14.1703.0", queryResults["Property:ProductVersion"]);
68
+ WixAssert.StringEqual("Property:TestPackageManufacturer\tExample Corporation", queryResults["Property:TestPackageManufacturer"]);
69
+ WixAssert.StringEqual("Property:TestPackageName\tPacakgeWithBindVariables", queryResults["Property:TestPackageName"]);
70
+ WixAssert.StringEqual("Property:TestPackageVersion\t3.14.1703.0", queryResults["Property:TestPackageVersion"]);
71
+ WixAssert.StringEqual("Property:TestTextVersion\tv", queryResults["Property:TestTextVersion"]);
72
Assert.False(queryResults.ContainsKey("Property:TestTextLanguage"));
73
}
74
}
src/wix/test/WixToolsetTest.CoreIntegration/BundleFixture.cs
+45
-37
@@ -86,44 +86,44 @@ namespace WixToolsetTest.CoreIntegration
86
var section = intermediate.Sections.Single();
87
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
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
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
97
var extractResult = BundleExtractor.ExtractBAContainer(null, exePath, baFolderPath, extractFolderPath);
98
extractResult.AssertSuccess();
99
100
var burnManifestData = wixOutput.GetData(BurnConstants.BurnManifestWixOutputStreamName);
101
var extractedBurnManifestData = File.ReadAllText(Path.Combine(baFolderPath, "manifest.xml"), Encoding.UTF8);
102
- Assert.Equal(extractedBurnManifestData, burnManifestData);
102
+ WixAssert.StringEqual(extractedBurnManifestData, burnManifestData);
103
104
var baManifestData = wixOutput.GetData(BurnConstants.BootstrapperApplicationDataWixOutputStreamName);
105
var extractedBaManifestData = File.ReadAllText(Path.Combine(baFolderPath, "BootstrapperApplicationData.xml"), Encoding.UTF8);
106
- Assert.Equal(extractedBaManifestData, baManifestData);
106
+ WixAssert.StringEqual(extractedBaManifestData, baManifestData);
107
108
var bextManifestData = wixOutput.GetData(BurnConstants.BundleExtensionDataWixOutputStreamName);
109
var extractedBextManifestData = File.ReadAllText(Path.Combine(baFolderPath, "BundleExtensionData.xml"), Encoding.UTF8);
110
- Assert.Equal(extractedBextManifestData, bextManifestData);
110
+ WixAssert.StringEqual(extractedBextManifestData, bextManifestData);
111
112
foreach (XmlAttribute attribute in extractResult.ManifestDocument.DocumentElement.Attributes)
113
{
114
switch (attribute.LocalName)
115
{
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;
119
case "ProtocolVersion":
120
- Assert.Equal("1", attribute.Value);
120
+ WixAssert.StringEqual("1", attribute.Value);
121
break;
122
case "Win64":
123
- Assert.Equal("no", attribute.Value);
123
+ WixAssert.StringEqual("no", attribute.Value);
124
break;
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;
128
default:
129
Assert.False(true, $"Attribute: '{attribute.LocalName}', Value: '{attribute.Value}'");
@@ -131,30 +131,38 @@ namespace WixToolsetTest.CoreIntegration
131
}
132
}
133
134
- var commandLineElements = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:CommandLine");
135
- var commandLineElement = (XmlNode)Assert.Single(commandLineElements);
136
- Assert.Equal("<CommandLine Variables='upperCase' />", commandLineElement.GetTestXml());
134
+ var commandLineElements = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:CommandLine");
135
+ WixAssert.CompareLineByLine(new[]
136
+ {
137
+ "<CommandLine Variables='upperCase' />",
138
+ }, commandLineElements);
139
138
- var logElements = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Log");
139
- var logElement = (XmlNode)Assert.Single(logElements);
140
- Assert.Equal("<Log PathVariable='WixBundleLog' Prefix='~TestBundle' Extension='log' />", logElement.GetTestXml());
140
+ var logElements = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Log");
141
+ WixAssert.CompareLineByLine(new[]
142
+ {
143
+ "<Log PathVariable='WixBundleLog' Prefix='~TestBundle' Extension='log' />",
144
+ }, logElements);
145
142
- var registrationElements = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Registration");
143
- var registrationElement = (XmlNode)Assert.Single(registrationElements);
144
- Assert.Equal($"<Registration Id='{bundleSymbol.BundleId}' ExecutableName='test.exe' PerMachine='yes' Tag='' Version='1.0.0.0' ProviderKey='{bundleSymbol.BundleId}'>" +
146
+ var registrationElements = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Registration");
147
+ WixAssert.CompareLineByLine(new[]
148
+ {
149
+ $"<Registration Id='{bundleSymbol.BundleId}' ExecutableName='test.exe' PerMachine='yes' Tag='' Version='1.0.0.0' ProviderKey='{bundleSymbol.BundleId}'>" +
150
"<Arp DisplayName='~TestBundle' DisplayVersion='1.0.0.0' InProgressDisplayName='~InProgressTestBundle' Publisher='Example Corporation' />" +
146
- "</Registration>", registrationElement.GetTestXml());
151
+ "</Registration>",
152
+ }, registrationElements);
153
148
- var msiPayloads = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Payload[@Id='test.msi']");
149
- var msiPayload = (XmlNode)Assert.Single(msiPayloads);
150
- Assert.Equal("<Payload Id='test.msi' FilePath='test.msi' FileSize='*' Hash='*' Packaging='embedded' SourcePath='a0' Container='WixAttachedContainer' />",
151
- msiPayload.GetTestXml(new Dictionary<string, List<string>>() { { "Payload", new List<string> { "FileSize", "Hash" } } }));
154
+ var ignoreAttributesByElementName = new Dictionary<string, List<string>>() { { "Payload", new List<string> { "FileSize", "Hash" } } };
155
+ var msiPayloads = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Payload[@Id='test.msi']", ignoreAttributesByElementName);
156
+ WixAssert.CompareLineByLine(new[]
157
+ {
158
+ "<Payload Id='test.msi' FilePath='test.msi' FileSize='*' Hash='*' Packaging='embedded' SourcePath='a0' Container='WixAttachedContainer' />",
159
+ }, msiPayloads);
160
}
161
162
var manifestResource = new Resource(ResourceType.Manifest, "#1", 1033);
163
manifestResource.Load(exePath);
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\"?>" +
166
"<assembly manifestVersion=\"1.0\" xmlns=\"urn:schemas-microsoft-com:asm.v1\">" +
167
"<assemblyIdentity name=\"test.exe\" version=\"1.0.0.0\" processorArchitecture=\"x86\" type=\"win32\" />" +
168
"<description>~TestBundle</description>" +
@@ -181,7 +189,7 @@ namespace WixToolsetTest.CoreIntegration
189
var attachedFolderPath = Path.Combine(baseFolder, "attached");
190
var extractFolderPath = Path.Combine(baseFolder, "extract");
191
184
- var result = WixRunner.Execute(false, new[] // TODO: go back to elevating warnings as errors.
192
+ var result = WixRunner.Execute(new[]
193
{
194
"build",
195
"-arch", "x64",
@@ -200,7 +208,7 @@ namespace WixToolsetTest.CoreIntegration
208
var manifestResource = new Resource(ResourceType.Manifest, "#1", 1033);
209
manifestResource.Load(exePath);
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\"?>" +
212
"<assembly manifestVersion=\"1.0\" xmlns=\"urn:schemas-microsoft-com:asm.v1\">" +
213
"<assemblyIdentity name=\"test.exe\" version=\"1.0.0.0\" processorArchitecture=\"amd64\" type=\"win32\" />" +
214
"<description>~TestBundle</description>" +
@@ -218,16 +226,16 @@ namespace WixToolsetTest.CoreIntegration
226
switch (attribute.LocalName)
227
{
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);
230
break;
231
case "ProtocolVersion":
224
- Assert.Equal("1", attribute.Value);
232
+ WixAssert.StringEqual("1", attribute.Value);
233
break;
234
case "Win64":
227
- Assert.Equal("yes", attribute.Value);
235
+ WixAssert.StringEqual("yes", attribute.Value);
236
break;
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);
239
break;
240
default:
241
Assert.False(true, $"Attribute: '{attribute.LocalName}', Value: '{attribute.Value}'");
@@ -433,7 +441,7 @@ namespace WixToolsetTest.CoreIntegration
441
}
442
443
[Fact]
436
- public void CantBuildWithDuplicateCacheIds()
444
+ public void CannotBuildWithDuplicateCacheIds()
445
{
446
var folder = TestData.Get(@"TestData");
447
@@ -459,7 +467,7 @@ namespace WixToolsetTest.CoreIntegration
467
}
468
469
[Fact]
462
- public void CantBuildWithDuplicatePayloadNames()
470
+ public void CannotBuildWithDuplicatePayloadNames()
471
{
472
var folder = TestData.Get(@"TestData");
473
@@ -520,7 +528,7 @@ namespace WixToolsetTest.CoreIntegration
528
}
529
530
[Fact]
523
- public void CantBuildWithOrphanPayload()
531
+ public void CannotBuildWithOrphanPayload()
532
{
533
var folder = TestData.Get(@"TestData");
534
@@ -547,7 +555,7 @@ namespace WixToolsetTest.CoreIntegration
555
}
556
557
[Fact]
550
- public void CantBuildWithPackageInMultipleContainers()
558
+ public void CannotBuildWithPackageInMultipleContainers()
559
{
560
var folder = TestData.Get(@"TestData");
561
@@ -603,7 +611,7 @@ namespace WixToolsetTest.CoreIntegration
611
}
612
613
[Fact]
606
- public void CantBuildWithUnscheduledPackage()
614
+ public void CannotBuildWithUnscheduledPackage()
615
{
616
var folder = TestData.Get(@"TestData");
617
@@ -629,7 +637,7 @@ namespace WixToolsetTest.CoreIntegration
637
}
638
639
[Fact]
632
- public void CantBuildWithUnscheduledRollbackBoundary()
640
+ public void CannotBuildWithUnscheduledRollbackBoundary()
641
{
642
var folder = TestData.Get(@"TestData");
643
src/wix/test/WixToolsetTest.CoreIntegration/BundleManifestFixture.cs
+88
-58
@@ -43,11 +43,13 @@ namespace WixToolsetTest.CoreIntegration
43
var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath);
44
extractResult.AssertSuccess();
45
46
- var customElements = extractResult.SelectBADataNodes("/ba:BootstrapperApplicationData/ba:BundleCustomTableBA");
47
- Assert.Equal(3, customElements.Count);
48
- Assert.Equal("<BundleCustomTableBA Id='one' Column2='two' />", customElements[0].GetTestXml());
49
- Assert.Equal("<BundleCustomTableBA Id='>' Column2='<' />", customElements[1].GetTestXml());
50
- Assert.Equal("<BundleCustomTableBA Id='1' Column2='2' />", customElements[2].GetTestXml());
46
+ var customElements = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:BundleCustomTableBA");
47
+ WixAssert.CompareLineByLine(new[]
48
+ {
49
+ "<BundleCustomTableBA Id='one' Column2='two' />",
50
+ "<BundleCustomTableBA Id='>' Column2='<' />",
51
+ "<BundleCustomTableBA Id='1' Column2='2' />",
52
+ }, customElements);
53
}
54
}
55
@@ -82,15 +84,17 @@ namespace WixToolsetTest.CoreIntegration
84
var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath);
85
extractResult.AssertSuccess();
86
85
- var packageElements = extractResult.SelectBADataNodes("/ba:BootstrapperApplicationData/ba:WixPackageProperties");
87
var ignoreAttributesByElementName = new Dictionary<string, List<string>>
88
{
89
{ "WixPackageProperties", new List<string> { "DownloadSize", "PackageSize", "InstalledSize", "Version" } },
90
};
90
- Assert.Equal(3, packageElements.Count);
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
- 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
- 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));
91
+ var packageElements = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixPackageProperties", ignoreAttributesByElementName);
92
+ WixAssert.CompareLineByLine(new[]
93
+ {
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);
98
}
99
}
100
@@ -125,16 +129,18 @@ namespace WixToolsetTest.CoreIntegration
129
var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath);
130
extractResult.AssertSuccess();
131
128
- var payloadElements = extractResult.SelectBADataNodes("/ba:BootstrapperApplicationData/ba:WixPayloadProperties");
132
var ignoreAttributesByElementName = new Dictionary<string, List<string>>
133
{
134
{ "WixPayloadProperties", new List<string> { "Size" } },
135
};
133
- Assert.Equal(4, payloadElements.Count);
134
- Assert.Equal("<WixPayloadProperties Package='credwiz.exe' Payload='SourceFilePayload' Container='WixAttachedContainer' Name='SharedPayloadsBetweenPackages.wxs' Size='*' />", payloadElements[0].GetTestXml(ignoreAttributesByElementName));
135
- Assert.Equal("<WixPayloadProperties Package='credwiz.exe' Payload='credwiz.exe' Container='WixAttachedContainer' Name='credwiz.exe' Size='*' />", payloadElements[1].GetTestXml(ignoreAttributesByElementName));
136
- Assert.Equal("<WixPayloadProperties Package='cscript.exe' Payload='SourceFilePayload' Container='WixAttachedContainer' Name='SharedPayloadsBetweenPackages.wxs' Size='*' />", payloadElements[2].GetTestXml(ignoreAttributesByElementName));
137
- Assert.Equal("<WixPayloadProperties Package='cscript.exe' Payload='cscript.exe' Container='WixAttachedContainer' Name='cscript.exe' Size='*' />", payloadElements[3].GetTestXml(ignoreAttributesByElementName));
136
+ var payloadElements = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixPayloadProperties", ignoreAttributesByElementName);
137
+ WixAssert.CompareLineByLine(new[]
138
+ {
139
+ "<WixPayloadProperties Package='credwiz.exe' Payload='SourceFilePayload' Container='WixAttachedContainer' Name='SharedPayloadsBetweenPackages.wxs' Size='*' />",
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);
144
}
145
}
146
@@ -167,17 +173,21 @@ namespace WixToolsetTest.CoreIntegration
173
var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath);
174
extractResult.AssertSuccess();
175
170
- var manifestRelatedBundlesElements = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:RelatedBundle");
171
- Assert.Equal("<RelatedBundle Id='{6D4CE32B-FB91-45DA-A9B5-7E0D9929A3C3}' Action='Upgrade' />", manifestRelatedBundlesElements[0].GetTestXml());
172
- Assert.Equal(1, manifestRelatedBundlesElements.Count);
176
+ var manifestRelatedBundlesElements = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:RelatedBundle");
177
+ WixAssert.CompareLineByLine(new[]
178
+ {
179
+ "<RelatedBundle Id='{6D4CE32B-FB91-45DA-A9B5-7E0D9929A3C3}' Action='Upgrade' />",
180
+ }, manifestRelatedBundlesElements);
181
174
- var dataRelatedBundlesElements = extractResult.SelectBADataNodes("/ba:BootstrapperApplicationData/ba:WixBundleProperties");
182
var ignoreAttributesByElementName = new Dictionary<string, List<string>>
183
{
184
{ "WixBundleProperties", new List<string> { "DisplayName", "Id" } },
185
};
179
- Assert.Equal("<WixBundleProperties DisplayName='*' LogPathVariable='WixBundleLog' Compressed='no' Id='*' UpgradeCode='{6D4CE32B-FB91-45DA-A9B5-7E0D9929A3C3}' PerMachine='yes' />", dataRelatedBundlesElements[0].GetTestXml(ignoreAttributesByElementName));
180
- Assert.Equal(1, dataRelatedBundlesElements.Count);
186
+ var dataRelatedBundlesElements = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixBundleProperties", ignoreAttributesByElementName);
187
+ WixAssert.CompareLineByLine(new[]
188
+ {
189
+ "<WixBundleProperties DisplayName='*' LogPathVariable='WixBundleLog' Compressed='no' Id='*' UpgradeCode='{6D4CE32B-FB91-45DA-A9B5-7E0D9929A3C3}' PerMachine='yes' />",
190
+ }, dataRelatedBundlesElements);
191
}
192
}
193
@@ -212,11 +222,13 @@ namespace WixToolsetTest.CoreIntegration
222
var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath);
223
extractResult.AssertSuccess();
224
215
- var customElements = extractResult.SelectBundleExtensionDataNodes("/be:BundleExtensionData/be:BundleExtension[@Id='CustomTableExtension']/be:BundleCustomTableBE");
216
- Assert.Equal(3, customElements.Count);
217
- Assert.Equal("<BundleCustomTableBE Id='one' Column2='two' />", customElements[0].GetTestXml());
218
- Assert.Equal("<BundleCustomTableBE Id='>' Column2='<' />", customElements[1].GetTestXml());
219
- Assert.Equal("<BundleCustomTableBE Id='1' Column2='2' />", customElements[2].GetTestXml());
225
+ var customElements = extractResult.GetBundleExtensionTestXmlLines("/be:BundleExtensionData/be:BundleExtension[@Id='CustomTableExtension']/be:BundleCustomTableBE");
226
+ WixAssert.CompareLineByLine(new[]
227
+ {
228
+ "<BundleCustomTableBE Id='one' Column2='two' />",
229
+ "<BundleCustomTableBE Id='>' Column2='<' />",
230
+ "<BundleCustomTableBE Id='1' Column2='2' />",
231
+ }, customElements);
232
}
233
}
234
@@ -252,13 +264,17 @@ namespace WixToolsetTest.CoreIntegration
264
var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath);
265
extractResult.AssertSuccess();
266
255
- var bundleExtensions = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:BundleExtension");
256
- Assert.Equal(1, bundleExtensions.Count);
257
- Assert.Equal("<BundleExtension Id='ExampleBext' EntryPayloadSourcePath='u1' />", bundleExtensions[0].GetTestXml());
267
+ var bundleExtensions = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:BundleExtension");
268
+ WixAssert.CompareLineByLine(new[]
269
+ {
270
+ "<BundleExtension Id='ExampleBext' EntryPayloadSourcePath='u1' />",
271
+ }, bundleExtensions);
272
259
- var bundleExtensionPayloads = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:UX/burn:Payload[@Id='ExampleBext']");
260
- Assert.Equal(1, bundleExtensionPayloads.Count);
261
- Assert.Equal("<Payload Id='ExampleBext' FilePath='fakebext.dll' SourcePath='u1' />", bundleExtensionPayloads[0].GetTestXml());
273
+ var bundleExtensionPayloads = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:UX/burn:Payload[@Id='ExampleBext']");
274
+ WixAssert.CompareLineByLine(new[]
275
+ {
276
+ "<Payload Id='ExampleBext' FilePath='fakebext.dll' SourcePath='u1' />",
277
+ }, bundleExtensionPayloads);
278
}
279
}
280
@@ -296,24 +312,34 @@ namespace WixToolsetTest.CoreIntegration
312
var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath);
313
extractResult.AssertSuccess();
314
299
- var bundleExtensions = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:BundleExtension");
300
- Assert.Equal(1, bundleExtensions.Count);
301
- Assert.Equal("<BundleExtension Id='ExampleBundleExtension' EntryPayloadSourcePath='u1' />", bundleExtensions[0].GetTestXml());
315
+ var bundleExtensions = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:BundleExtension");
316
+ WixAssert.CompareLineByLine(new[]
317
+ {
318
+ "<BundleExtension Id='ExampleBundleExtension' EntryPayloadSourcePath='u1' />",
319
+ }, bundleExtensions);
320
303
- var extensionSearches = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:ExtensionSearch");
304
- Assert.Equal(2, extensionSearches.Count);
305
- Assert.Equal("<ExtensionSearch Id='ExampleSearchBar' Variable='SearchBar' Condition='WixBundleInstalled' ExtensionId='ExampleBundleExtension' />", extensionSearches[0].GetTestXml());
306
- Assert.Equal("<ExtensionSearch Id='ExampleSearchFoo' Variable='SearchFoo' ExtensionId='ExampleBundleExtension' />", extensionSearches[1].GetTestXml());
321
+ var extensionSearches = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:ExtensionSearch");
322
+ WixAssert.CompareLineByLine(new[]
323
+ {
324
+ "<ExtensionSearch Id='ExampleSearchBar' Variable='SearchBar' Condition='WixBundleInstalled' ExtensionId='ExampleBundleExtension' />",
325
+ "<ExtensionSearch Id='ExampleSearchFoo' Variable='SearchFoo' ExtensionId='ExampleBundleExtension' />",
326
+ }, extensionSearches);
327
308
- var bundleExtensionDatas = extractResult.SelectBundleExtensionDataNodes("/be:BundleExtensionData/be:BundleExtension[@Id='ExampleBundleExtension']");
309
- Assert.Equal(1, bundleExtensionDatas.Count);
310
- Assert.Equal("<BundleExtension Id='ExampleBundleExtension'>" +
328
+ var bundleExtensionDatas = extractResult.GetBundleExtensionTestXmlLines("/be:BundleExtensionData/be:BundleExtension[@Id='ExampleBundleExtension']");
329
+ WixAssert.CompareLineByLine(new[]
330
+ {
331
+ "<BundleExtension Id='ExampleBundleExtension'>" +
332
"<ExampleSearch Id='ExampleSearchBar' SearchFor='Bar' />" +
333
"<ExampleSearch Id='ExampleSearchFoo' SearchFor='Foo' />" +
313
- "</BundleExtension>", bundleExtensionDatas[0].GetTestXml());
334
+ "</BundleExtension>"
335
+ }, bundleExtensionDatas);
336
315
- var exampleSearches = extractResult.SelectBundleExtensionDataNodes("/be:BundleExtensionData/be:BundleExtension[@Id='ExampleBundleExtension']/be:ExampleSearch");
316
- Assert.Equal(2, exampleSearches.Count);
337
+ var exampleSearches = extractResult.GetBundleExtensionTestXmlLines("/be:BundleExtensionData/be:BundleExtension[@Id='ExampleBundleExtension']/be:ExampleSearch");
338
+ WixAssert.CompareLineByLine(new[]
339
+ {
340
+ "<ExampleSearch Id='ExampleSearchBar' SearchFor='Bar' />",
341
+ "<ExampleSearch Id='ExampleSearchFoo' SearchFor='Foo' />",
342
+ }, exampleSearches);
343
}
344
}
345
@@ -348,14 +374,16 @@ namespace WixToolsetTest.CoreIntegration
374
var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath);
375
extractResult.AssertSuccess();
376
351
- var exePackageElements = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Chain/burn:ExePackage");
377
var ignoreAttributesByElementName = new Dictionary<string, List<string>>
378
{
379
{ "ExePackage", new List<string> { "CacheId", "InstallSize", "Size" } },
380
};
356
- Assert.Equal(2, exePackageElements.Count);
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));
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));
381
+ var exePackageElements = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/burn:ExePackage", ignoreAttributesByElementName);
382
+ WixAssert.CompareLineByLine(new[]
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);
387
}
388
}
389
@@ -390,14 +418,16 @@ namespace WixToolsetTest.CoreIntegration
418
var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath);
419
extractResult.AssertSuccess();
420
393
- var setVariables = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:SetVariable");
394
- Assert.Equal(6, setVariables.Count);
395
- Assert.Equal("<SetVariable Id='SetCoercedNumber' Variable='CoercedNumber' Value='2' Type='numeric' />", setVariables[0].GetTestXml());
396
- Assert.Equal("<SetVariable Id='SetCoercedString' Variable='CoercedString' Value='Bar' Type='string' />", setVariables[1].GetTestXml());
397
- Assert.Equal("<SetVariable Id='SetCoercedVersion' Variable='CoercedVersion' Value='v2.0' Type='version' />", setVariables[2].GetTestXml());
398
- Assert.Equal("<SetVariable Id='SetNeedsFormatting' Variable='NeedsFormatting' Value='[One] [Two] [Three]' Type='string' />", setVariables[3].GetTestXml());
399
- Assert.Equal("<SetVariable Id='SetVersionString' Variable='VersionString' Value='v1.0' Type='string' />", setVariables[4].GetTestXml());
400
- Assert.Equal("<SetVariable Id='SetUnset' Variable='Unset' Condition='VersionString = v2.0' />", setVariables[5].GetTestXml());
421
+ var setVariables = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:SetVariable");
422
+ WixAssert.CompareLineByLine(new[]
423
+ {
424
+ "<SetVariable Id='SetCoercedNumber' Variable='CoercedNumber' Value='2' Type='numeric' />",
425
+ "<SetVariable Id='SetCoercedString' Variable='CoercedString' Value='Bar' Type='string' />",
426
+ "<SetVariable Id='SetCoercedVersion' Variable='CoercedVersion' Value='v2.0' Type='version' />",
427
+ "<SetVariable Id='SetNeedsFormatting' Variable='NeedsFormatting' Value='[One] [Two] [Three]' Type='string' />",
428
+ "<SetVariable Id='SetVersionString' Variable='VersionString' Value='v1.0' Type='string' />",
429
+ "<SetVariable Id='SetUnset' Variable='Unset' Condition='VersionString = v2.0' />",
430
+ }, setVariables);
431
}
432
}
433
}
src/wix/test/WixToolsetTest.CoreIntegration/BundlePackageFixture.cs
+26
-65
@@ -96,11 +96,8 @@ namespace WixToolsetTest.CoreIntegration
96
{
97
{ "BundlePackage", new List<string> { "Size" } },
98
};
99
- var bundlePackages = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Chain/burn:BundlePackage")
100
- .Cast<XmlElement>()
101
- .Select(e => e.GetTestXml(ignoreAttributesByElementName))
102
- .ToArray();
103
- WixAssert.CompareLineByLine(new string[]
99
+ var bundlePackages = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/burn:BundlePackage", ignoreAttributesByElementName);
100
+ WixAssert.CompareLineByLine(new[]
101
{
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'>" +
103
"<Provides Key='MyProviderKey,v1.0' Version='1.0.0.0' DisplayName='BurnBundle' Imported='yes' />" +
@@ -110,11 +107,8 @@ namespace WixToolsetTest.CoreIntegration
107
"</BundlePackage>",
108
}, bundlePackages);
109
113
- var registrations = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Registration")
114
- .Cast<XmlElement>()
115
- .Select(e => e.GetTestXml())
116
- .ToArray();
117
- WixAssert.CompareLineByLine(new string[]
110
+ var registrations = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Registration");
111
+ WixAssert.CompareLineByLine(new[]
112
{
113
$"<Registration Id='{parentBundleId}' ExecutableName='parent.exe' PerMachine='yes' Tag='' Version='1.0.1.0' ProviderKey='{parentBundleId}'>" +
114
"<Arp DisplayName='BundlePackageBundle' DisplayVersion='1.0.1.0' Publisher='Example Corporation' />" +
@@ -125,11 +119,8 @@ namespace WixToolsetTest.CoreIntegration
119
{
120
{ "WixPackageProperties", new List<string> { "DownloadSize", "PackageSize" } },
121
};
128
- var packageElements = extractResult.SelectBADataNodes("/ba:BootstrapperApplicationData/ba:WixPackageProperties")
129
- .Cast<XmlElement>()
130
- .Select(e => e.GetTestXml(ignoreAttributesByElementName))
131
- .ToArray();
132
- WixAssert.CompareLineByLine(new string[]
122
+ var packageElements = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixPackageProperties", ignoreAttributesByElementName);
123
+ WixAssert.CompareLineByLine(new[]
124
{
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' />",
126
}, packageElements);
@@ -167,11 +158,8 @@ namespace WixToolsetTest.CoreIntegration
158
{
159
{ "BundlePackage", new List<string> { "Size" } },
160
};
170
- bundlePackages = grandparentExtractResult.SelectManifestNodes("/burn:BurnManifest/burn:Chain/burn:BundlePackage")
171
- .Cast<XmlElement>()
172
- .Select(e => e.GetTestXml(ignoreAttributesByElementName))
173
- .ToArray();
174
- WixAssert.CompareLineByLine(new string[]
161
+ bundlePackages = grandparentExtractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/burn:BundlePackage", ignoreAttributesByElementName);
162
+ WixAssert.CompareLineByLine(new[]
163
{
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'>" +
165
$"<Provides Key='{parentBundleId}' Version='1.0.1.0' DisplayName='BundlePackageBundle' Imported='yes' />" +
@@ -184,21 +172,15 @@ namespace WixToolsetTest.CoreIntegration
172
{
173
{ "Payload", new List<string> { "FileSize", "Hash" } },
174
};
187
- var payloads = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Payload")
188
- .Cast<XmlElement>()
189
- .Select(e => e.GetTestXml(ignoreAttributesByElementName))
190
- .ToArray();
191
- WixAssert.CompareLineByLine(new string[]
175
+ var payloads = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Payload", ignoreAttributesByElementName);
176
+ WixAssert.CompareLineByLine(new[]
177
{
178
"<Payload Id='payP6wZpeHEAZbDUQPEKeCpQ_9bN.4' FilePath='signed_cab1.cab' FileSize='*' Hash='*' Packaging='external' SourcePath='signed_cab1.cab' />",
179
"<Payload Id='chain.exe' FilePath='chain.exe' FileSize='*' Hash='*' Packaging='external' SourcePath='chain.exe' />",
180
}, payloads);
181
197
- registrations = grandparentExtractResult.SelectManifestNodes("/burn:BurnManifest/burn:Registration")
198
- .Cast<XmlElement>()
199
- .Select(e => e.GetTestXml())
200
- .ToArray();
201
- WixAssert.CompareLineByLine(new string[]
182
+ registrations = grandparentExtractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Registration");
183
+ WixAssert.CompareLineByLine(new[]
184
{
185
$"<Registration Id='{grandparentBundleId}' ExecutableName='grandparent.exe' PerMachine='yes' Tag='' Version='1.0.2.0' ProviderKey='{grandparentBundleId}'>" +
186
"<Arp DisplayName='PermanentBundlePackageBundle' DisplayVersion='1.0.2.0' Publisher='Example Corporation' />" +
@@ -209,11 +191,8 @@ namespace WixToolsetTest.CoreIntegration
191
{
192
{ "WixPackageProperties", new List<string> { "DownloadSize", "PackageSize" } },
193
};
212
- packageElements = grandparentExtractResult.SelectBADataNodes("/ba:BootstrapperApplicationData/ba:WixPackageProperties")
213
- .Cast<XmlElement>()
214
- .Select(e => e.GetTestXml(ignoreAttributesByElementName))
215
- .ToArray();
216
- WixAssert.CompareLineByLine(new string[]
194
+ packageElements = grandparentExtractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixPackageProperties", ignoreAttributesByElementName);
195
+ WixAssert.CompareLineByLine(new[]
196
{
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' />",
198
}, packageElements);
@@ -268,11 +247,8 @@ namespace WixToolsetTest.CoreIntegration
247
{
248
{ "BundlePackage", new List<string> { "Size" } },
249
};
271
- var bundlePackages = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Chain/burn:BundlePackage")
272
- .Cast<XmlElement>()
273
- .Select(e => e.GetTestXml(ignoreAttributesByElementName))
274
- .ToArray();
275
- WixAssert.CompareLineByLine(new string[]
250
+ var bundlePackages = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/burn:BundlePackage", ignoreAttributesByElementName);
251
+ WixAssert.CompareLineByLine(new[]
252
{
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'>" +
254
"<Provides Key='MyProviderKey,v1.0' Version='1.0.0-foo.55' DisplayName='BurnBundle' Imported='yes' />" +
@@ -281,11 +257,8 @@ namespace WixToolsetTest.CoreIntegration
257
"</BundlePackage>",
258
}, bundlePackages);
259
284
- var registrations = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Registration")
285
- .Cast<XmlElement>()
286
- .Select(e => e.GetTestXml())
287
- .ToArray();
288
- WixAssert.CompareLineByLine(new string[]
260
+ var registrations = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Registration");
261
+ WixAssert.CompareLineByLine(new[]
262
{
263
$"<Registration Id='{parentBundleId}' ExecutableName='parent.exe' PerMachine='yes' Tag='' Version='1.0.1.0' ProviderKey='{parentBundleId}'>" +
264
"<Arp DisplayName='RemoteBundlePackageBundle' DisplayVersion='1.0.1.0' Publisher='Example Corporation' />" +
@@ -296,11 +269,8 @@ namespace WixToolsetTest.CoreIntegration
269
{
270
{ "WixPackageProperties", new List<string> { "DownloadSize", "PackageSize" } },
271
};
299
- var packageElements = extractResult.SelectBADataNodes("/ba:BootstrapperApplicationData/ba:WixPackageProperties")
300
- .Cast<XmlElement>()
301
- .Select(e => e.GetTestXml(ignoreAttributesByElementName))
302
- .ToArray();
303
- WixAssert.CompareLineByLine(new string[]
272
+ var packageElements = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixPackageProperties", ignoreAttributesByElementName);
273
+ WixAssert.CompareLineByLine(new[]
274
{
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' />",
276
}, packageElements);
@@ -364,11 +334,8 @@ namespace WixToolsetTest.CoreIntegration
334
{
335
{ "BundlePackage", new List<string> { "Size" } },
336
};
367
- var bundlePackages = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Chain/burn:BundlePackage")
368
- .Cast<XmlElement>()
369
- .Select(e => e.GetTestXml(ignoreAttributesByElementName))
370
- .ToArray();
371
- WixAssert.CompareLineByLine(new string[]
337
+ var bundlePackages = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/burn:BundlePackage", ignoreAttributesByElementName);
338
+ WixAssert.CompareLineByLine(new[]
339
{
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'>" +
341
"<Provides Key='{215a70db-ab35-48c7-be51-d66eaac87177}' Version='1.0.0.0' DisplayName='CustomV3Theme' Imported='yes' />" +
@@ -377,11 +344,8 @@ namespace WixToolsetTest.CoreIntegration
344
"</BundlePackage>",
345
}, bundlePackages);
346
380
- var registrations = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Registration")
381
- .Cast<XmlElement>()
382
- .Select(e => e.GetTestXml())
383
- .ToArray();
384
- WixAssert.CompareLineByLine(new string[]
347
+ var registrations = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Registration");
348
+ WixAssert.CompareLineByLine(new[]
349
{
350
$"<Registration Id='{parentBundleId}' ExecutableName='parent.exe' PerMachine='yes' Tag='' Version='1.1.1.1' ProviderKey='{parentBundleId}'>" +
351
"<Arp DisplayName='V3BundlePackageBundle' DisplayVersion='1.1.1.1' Publisher='Example Corporation' />" +
@@ -392,11 +356,8 @@ namespace WixToolsetTest.CoreIntegration
356
{
357
{ "WixPackageProperties", new List<string> { "DownloadSize", "PackageSize" } },
358
};
395
- var packageElements = extractResult.SelectBADataNodes("/ba:BootstrapperApplicationData/ba:WixPackageProperties")
396
- .Cast<XmlElement>()
397
- .Select(e => e.GetTestXml(ignoreAttributesByElementName))
398
- .ToArray();
399
- WixAssert.CompareLineByLine(new string[]
359
+ var packageElements = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixPackageProperties", ignoreAttributesByElementName);
360
+ WixAssert.CompareLineByLine(new[]
361
{
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' />",
363
}, packageElements);
src/wix/test/WixToolsetTest.CoreIntegration/CabFixture.cs
+2
-2
@@ -45,7 +45,7 @@ namespace WixToolsetTest.CoreIntegration
45
WixAssert.CompareLineByLine(new[] { "Notepad.exe", "test.txt" }, fileRows.Select(f => f.Name).ToArray());
46
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
}
50
}
51
@@ -90,7 +90,7 @@ namespace WixToolsetTest.CoreIntegration
90
WixAssert.CompareLineByLine(new[] { "test.txt" }, fileRows.Select(f => f.Name).ToArray());
91
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
}
95
}
96
src/wix/test/WixToolsetTest.CoreIntegration/ContainerFixture.cs
+29
-40
@@ -50,13 +50,15 @@ namespace WixToolsetTest.CoreIntegration
50
var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath);
51
extractResult.AssertSuccess();
52
53
- var payloads = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Payload");
54
- Assert.Equal(4, payloads.Count);
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));
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));
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));
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));
54
+ var payloads = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Payload", ignoreAttributes);
55
+ WixAssert.CompareLineByLine(new[]
56
+ {
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);
62
}
63
}
64
@@ -94,13 +96,15 @@ namespace WixToolsetTest.CoreIntegration
96
var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath);
97
extractResult.AssertSuccess();
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" } } };
100
- Assert.Equal(@"<Payload Id='FirstX86.msi' FilePath='FirstX86.msi' FileSize='*' Hash='*' Packaging='embedded' SourcePath='a0' Container='WixAttachedContainer' />", payloads[0].GetTestXml(ignoreAttributes));
101
- Assert.Equal(@"<Payload Id='FirstX64.msi' FilePath='FirstX64.msi' FileSize='*' Hash='*' Packaging='embedded' SourcePath='a1' Container='FirstX64' />", payloads[1].GetTestXml(ignoreAttributes));
102
- Assert.Equal(@"<Payload Id='fk1m38Cf9RZ2Bx_ipinRY6BftelU' FilePath='PFiles\MsiPackage\test.txt' FileSize='*' Hash='*' Packaging='embedded' SourcePath='a2' Container='WixAttachedContainer' />", payloads[2].GetTestXml(ignoreAttributes));
103
- Assert.Equal(@"<Payload Id='fC0n41rZK8oW3JK8LzHu6AT3CjdQ' FilePath='PFiles\MsiPackage\test.txt' FileSize='*' Hash='*' Packaging='embedded' SourcePath='a3' Container='FirstX64' />", payloads[3].GetTestXml(ignoreAttributes));
100
+ var payloads = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Payload", ignoreAttributes);
101
+ WixAssert.CompareLineByLine(new[]
102
+ {
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);
108
}
109
}
110
@@ -142,11 +146,8 @@ namespace WixToolsetTest.CoreIntegration
146
{
147
{ "MsiPackage", new List<string> { "CacheId", "InstallSize", "Size", "ProductCode" } },
148
};
145
- var msiPackages = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Chain/burn:MsiPackage")
146
- .Cast<XmlElement>()
147
- .Select(e => e.GetTestXml(ignoreAttributes))
148
- .ToArray();
149
- WixAssert.CompareLineByLine(new string[]
149
+ var msiPackages = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/burn:MsiPackage", ignoreAttributes);
150
+ WixAssert.CompareLineByLine(new[]
151
{
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}'>" +
153
"<MsiProperty Id='MSIFASTINSTALL' Value='1' />" +
@@ -196,7 +197,7 @@ namespace WixToolsetTest.CoreIntegration
197
"-o", bundlePath
198
});
199
199
- WixAssert.CompareLineByLine(new string[]
200
+ WixAssert.CompareLineByLine(new[]
201
{
202
"The layout-only Payload 'SharedPayload' is being added to Container 'FirstX64'. It will not be extracted during layout.",
203
}, result.Messages.Select(m => m.ToString()).ToArray());
@@ -208,11 +209,8 @@ namespace WixToolsetTest.CoreIntegration
209
extractResult.AssertSuccess();
210
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
- .Cast<XmlElement>()
213
- .Select(e => e.GetTestXml(ignoreAttributes))
214
- .ToArray();
215
- WixAssert.CompareLineByLine(new string[]
212
+ var payloads = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Payload[@Id='SharedPayload']", ignoreAttributes);
213
+ WixAssert.CompareLineByLine(new[]
214
{
215
"<Payload Id='SharedPayload' FilePath='LayoutPayloadInContainer.wxs' FileSize='*' Hash='*' LayoutOnly='yes' Packaging='embedded' SourcePath='a1' Container='FirstX64' />",
216
}, payloads);
@@ -257,11 +255,8 @@ namespace WixToolsetTest.CoreIntegration
255
Assert.True(File.Exists(Path.Combine(attachedFolderPath, "WixAttachedContainer", "FirstX86.msi")), "Expected extracted container to contain FirstX86.msi");
256
257
var ignoreAttributes = new Dictionary<string, List<string>> { { "Payload", new List<string> { "FileSize", "Hash" } } };
260
- var payloads = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Payload")
261
- .Cast<XmlElement>()
262
- .Select(e => e.GetTestXml(ignoreAttributes))
263
- .ToArray();
264
- WixAssert.CompareLineByLine(new string[]
258
+ var payloads = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Payload", ignoreAttributes);
259
+ WixAssert.CompareLineByLine(new[]
260
{
261
"<Payload Id='FirstX86.msi' FilePath='FirstX86.msi' FileSize='*' Hash='*' Packaging='embedded' SourcePath='a0' Container='WixAttachedContainer' />",
262
"<Payload Id='FirstX64.msi' FilePath='FirstX64.msi' FileSize='*' Hash='*' Packaging='embedded' SourcePath='a1' Container='FirstX64' />",
@@ -298,7 +293,7 @@ namespace WixToolsetTest.CoreIntegration
293
"-o", bundlePath
294
});
295
301
- WixAssert.CompareLineByLine(new string[]
296
+ WixAssert.CompareLineByLine(new[]
297
{
298
"The Payload 'SharedPayload' can't be added to Container 'FirstX64' because it was already added to Container 'FirstX86'.",
299
}, result.Messages.Select(m => m.ToString()).ToArray());
@@ -310,11 +305,8 @@ namespace WixToolsetTest.CoreIntegration
305
extractResult.AssertSuccess();
306
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']")
314
- .Cast<XmlElement>()
315
- .Select(e => e.GetTestXml(ignoreAttributes))
316
- .ToArray();
317
- WixAssert.CompareLineByLine(new string[]
308
+ var payloads = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Payload[@Id='SharedPayload']", ignoreAttributes);
309
+ WixAssert.CompareLineByLine(new[]
310
{
311
"<Payload Id='SharedPayload' FilePath='PayloadInMultipleContainers.wxs' FileSize='*' Hash='*' Packaging='embedded' SourcePath='a2' Container='FirstX86' />",
312
}, payloads);
@@ -347,7 +339,7 @@ namespace WixToolsetTest.CoreIntegration
339
"-o", bundlePath
340
});
341
350
- WixAssert.CompareLineByLine(new string[]
342
+ WixAssert.CompareLineByLine(new[]
343
{
344
"The layout-only Payload 'SharedPayload' is being added to Container 'FirstX64'. It will not be extracted during layout.",
345
}, result.Messages.Select(m => m.ToString()).ToArray());
@@ -362,11 +354,8 @@ namespace WixToolsetTest.CoreIntegration
354
{
355
{ "WixPayloadProperties", new List<string> { "Size" } },
356
};
365
- var payloads = extractResult.SelectBADataNodes("/ba:BootstrapperApplicationData/ba:WixPayloadProperties")
366
- .Cast<XmlElement>()
367
- .Select(e => e.GetTestXml(ignoreAttributesByElementName))
368
- .ToArray();
369
- WixAssert.CompareLineByLine(new string[]
357
+ var payloads = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixPayloadProperties", ignoreAttributesByElementName);
358
+ WixAssert.CompareLineByLine(new[]
359
{
360
"<WixPayloadProperties Package='FirstX64.msi' Payload='FirstX64.msi' Container='FirstX64' Name='FirstX64.msi' Size='*' />",
361
"<WixPayloadProperties Package='FirstX64.msi' Payload='SharedPayload' Container='FirstX64' Name='LayoutPayloadInContainer.wxs' Size='*' />",
src/wix/test/WixToolsetTest.CoreIntegration/CopyFileFixture.cs
+2
-2
@@ -39,9 +39,9 @@ namespace WixToolsetTest.CoreIntegration
39
var intermediate = Intermediate.Load(Path.Combine(baseFolder, @"bin\test.wixpdb"));
40
var section = intermediate.Sections.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);
44
- Assert.Equal("OtherFolder", copyFileSymbol.DestFolder);
44
+ WixAssert.StringEqual("OtherFolder", copyFileSymbol.DestFolder);
45
}
46
}
47
}
src/wix/test/WixToolsetTest.CoreIntegration/CustomActionFixture.cs
+2
-2
@@ -33,7 +33,7 @@ namespace WixToolsetTest.CoreIntegration
33
});
34
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
}
38
}
39
@@ -60,7 +60,7 @@ namespace WixToolsetTest.CoreIntegration
60
});
61
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
}
65
}
66
src/wix/test/WixToolsetTest.CoreIntegration/DependencyExtensionFixture.cs
+7
-16
@@ -44,11 +44,8 @@ namespace WixToolsetTest.CoreIntegration
44
var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath);
45
extractResult.AssertSuccess();
46
47
- var provides = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Chain/burn:ExePackage/burn:Provides")
48
- .Cast<XmlElement>()
49
- .Select(e => e.GetTestXml())
50
- .ToArray();
51
- WixAssert.CompareLineByLine(new string[]
47
+ var provides = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/burn:ExePackage/burn:Provides");
48
+ WixAssert.CompareLineByLine(new[]
49
{
50
"<Provides Key='DependencyTests_ExeA,v1.0' Version='1.0.0.0' DisplayName='Windows Installer XML Toolset' />",
51
}, provides);
@@ -100,11 +97,8 @@ namespace WixToolsetTest.CoreIntegration
97
var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath);
98
extractResult.AssertSuccess();
99
103
- var provides = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Chain/burn:MsiPackage/burn:Provides")
104
- .Cast<XmlElement>()
105
- .Select(e => e.GetTestXml())
106
- .ToArray();
107
- WixAssert.CompareLineByLine(new string[]
100
+ var provides = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/burn:MsiPackage/burn:Provides");
101
+ WixAssert.CompareLineByLine(new[]
102
{
103
"<Provides Key='UsingProvides' Version='1.0.0.0' DisplayName='MsiPackage' Imported='yes' />",
104
}, provides);
@@ -146,10 +140,7 @@ namespace WixToolsetTest.CoreIntegration
140
{
141
{ "Registration", new List<string> { "Id" } },
142
};
149
- var registration = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Registration")
150
- .Cast<XmlElement>()
151
- .Select(e => e.GetTestXml(ignoreAttributesByElementName))
152
- .ToArray();
143
+ var registration = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Registration", ignoreAttributesByElementName);
144
WixAssert.CompareLineByLine(new string[]
145
{
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
163
164
private static void Build(string[] args)
165
{
175
- var result = WixRunner.Execute(args)
176
- .AssertSuccess();
166
+ var result = WixRunner.Execute(args);
167
+ result.AssertSuccess();
168
}
169
}
170
}
src/wix/test/WixToolsetTest.CoreIntegration/ExePackageFixture.cs
+4
-16
@@ -48,10 +48,7 @@ namespace WixToolsetTest.CoreIntegration
48
{
49
{ "ExePackage", new List<string> { "CacheId", "Size" } },
50
};
51
- var exePackages = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Chain/burn:ExePackage")
52
- .Cast<XmlElement>()
53
- .Select(e => e.GetTestXml(ignoreAttributes))
54
- .ToArray();
51
+ var exePackages = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/burn:ExePackage", ignoreAttributes);
52
WixAssert.CompareLineByLine(new string[]
53
{
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
98
{
99
{ "ExePackage", new List<string> { "CacheId", "Size" } },
100
};
104
- var exePackages = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Chain/burn:ExePackage")
105
- .Cast<XmlElement>()
106
- .Select(e => e.GetTestXml(ignoreAttributes))
107
- .ToArray();
101
+ var exePackages = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/burn:ExePackage", ignoreAttributes);
102
WixAssert.CompareLineByLine(new string[]
103
{
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
148
{
149
{ "ExePackage", new List<string> { "CacheId", "Size" } },
150
};
157
- var exePackages = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Chain/burn:ExePackage")
158
- .Cast<XmlElement>()
159
- .Select(e => e.GetTestXml(ignoreAttributes))
160
- .ToArray();
151
+ var exePackages = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/burn:ExePackage", ignoreAttributes);
152
WixAssert.CompareLineByLine(new string[]
153
{
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
194
{
195
{ "ExePackage", new List<string> { "CacheId", "Size" } },
196
};
206
- var exePackages = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Chain/burn:ExePackage")
207
- .Cast<XmlElement>()
208
- .Select(e => e.GetTestXml(ignoreAttributes))
209
- .ToArray();
197
+ var exePackages = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/burn:ExePackage", ignoreAttributes);
198
WixAssert.CompareLineByLine(new string[]
199
{
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'>" +
src/wix/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs
+8
-8
@@ -43,7 +43,7 @@ namespace WixToolsetTest.CoreIntegration
43
build.BuildAndDecompileAndBuild(Build, Decompile, actualOutputPath);
44
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);
48
}
49
}
@@ -87,13 +87,13 @@ namespace WixToolsetTest.CoreIntegration
87
var section = intermediate.Sections.Single();
88
89
var fileSymbol = section.Symbols.OfType<FileSymbol>().Single();
90
- Assert.Equal(Path.Combine(folder, @"data\example.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path);
91
- Assert.Equal(@"example.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path);
90
+ WixAssert.StringEqual(Path.Combine(folder, @"data\example.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path);
91
+ WixAssert.StringEqual(@"example.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path);
92
93
var example = section.Symbols.Where(t => t.Definition.Type == SymbolDefinitionType.MustBeFromAnExtension).Single();
94
- Assert.Equal("Foo", example.Id?.Id);
95
- Assert.Equal("filF5_pLhBuF5b4N9XEo52g_hUM5Lo", example[0].AsString());
96
- Assert.Equal("Bar", example[1].AsString());
94
+ WixAssert.StringEqual("Foo", example.Id?.Id);
95
+ WixAssert.StringEqual("filF5_pLhBuF5b4N9XEo52g_hUM5Lo", example[0].AsString());
96
+ WixAssert.StringEqual("Bar", example[1].AsString());
97
}
98
}
99
@@ -126,8 +126,8 @@ namespace WixToolsetTest.CoreIntegration
126
var section = intermediate.Sections.Single();
127
128
var property = section.Symbols.OfType<PropertySymbol>().Where(p => p.Id.Id == "ExampleProperty").Single();
129
- Assert.Equal("ExampleProperty", property.Id.Id);
130
- Assert.Equal("test", property.Value);
129
+ WixAssert.StringEqual("ExampleProperty", property.Id.Id);
130
+ WixAssert.StringEqual("test", property.Value);
131
}
132
}
133
src/wix/test/WixToolsetTest.CoreIntegration/LinkerFixture.cs
+3
-3
@@ -103,7 +103,7 @@ namespace WixToolsetTest.CoreIntegration
103
}
104
catch (WixException we)
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;
108
}
109
@@ -133,7 +133,7 @@ namespace WixToolsetTest.CoreIntegration
133
}
134
catch (WixException we)
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;
138
}
139
@@ -163,7 +163,7 @@ namespace WixToolsetTest.CoreIntegration
163
}
164
catch (WixException we)
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;
168
}
169
src/wix/test/WixToolsetTest.CoreIntegration/ModuleFixture.cs
-5
@@ -2,14 +2,9 @@
2
3
namespace WixToolsetTest.CoreIntegration
4
{
5
- using System;
5
using System.IO;
7
- using System.Linq;
6
using WixBuildTools.TestSupport;
7
using WixToolset.Core.TestPackage;
10
- using WixToolset.Data;
11
- using WixToolset.Data.Symbols;
12
- using WixToolset.Data.WindowsInstaller;
8
using Xunit;
9
10
public class ModuleFixture
src/wix/test/WixToolsetTest.CoreIntegration/MsiFixture.cs
+23
-23
@@ -52,8 +52,8 @@ namespace WixToolsetTest.CoreIntegration
52
var section = intermediate.Sections.Single();
53
54
var fileSymbol = section.Symbols.OfType<FileSymbol>().First();
55
- Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path);
56
- Assert.Equal(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path);
55
+ WixAssert.StringEqual(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path);
56
+ WixAssert.StringEqual(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path);
57
}
58
}
59
@@ -87,8 +87,8 @@ namespace WixToolsetTest.CoreIntegration
87
var section = intermediate.Sections.Single();
88
89
var fileSymbol = section.Symbols.OfType<FileSymbol>().Single();
90
- Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path);
91
- Assert.Equal(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path);
90
+ WixAssert.StringEqual(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path);
91
+ WixAssert.StringEqual(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path);
92
}
93
}
94
@@ -246,14 +246,14 @@ namespace WixToolsetTest.CoreIntegration
246
var section = intermediate.Sections.Single();
247
248
var errors = section.Symbols.OfType<ErrorSymbol>().ToDictionary(t => t.Id.Id);
249
- Assert.Equal("Category 55 Emergency Doomsday Crisis", errors["1234"].Message.Trim());
250
- Assert.Equal(" ", errors["5678"].Message);
249
+ WixAssert.StringEqual("Category 55 Emergency Doomsday Crisis", errors["1234"].Message.Trim());
250
+ WixAssert.StringEqual(" ", errors["5678"].Message);
251
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
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
}
258
}
259
@@ -461,7 +461,7 @@ namespace WixToolsetTest.CoreIntegration
461
Assert.NotNull(wixout.GetDataStream("wix-ir.json"));
462
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
}
466
}
467
}
@@ -491,13 +491,13 @@ namespace WixToolsetTest.CoreIntegration
491
Assert.NotNull(wixout.GetDataStream("wix-ir.json"));
492
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
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
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
}
502
}
503
}
@@ -533,8 +533,8 @@ namespace WixToolsetTest.CoreIntegration
533
var section = intermediate.Sections.Single();
534
535
var fileSymbol = section.Symbols.OfType<FileSymbol>().Single();
536
- Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path);
537
- Assert.Equal(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path);
536
+ WixAssert.StringEqual(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path);
537
+ WixAssert.StringEqual(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path);
538
}
539
}
540
@@ -569,8 +569,8 @@ namespace WixToolsetTest.CoreIntegration
569
var section = intermediate.Sections.Single();
570
571
var fileSymbol = section.Symbols.OfType<FileSymbol>().Single();
572
- Assert.Equal(Path.Combine(folder, @"data\candle.exe"), fileSymbol[FileSymbolFields.Source].AsPath().Path);
573
- Assert.Equal(@"candle.exe", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path);
572
+ WixAssert.StringEqual(Path.Combine(folder, @"data\candle.exe"), fileSymbol[FileSymbolFields.Source].AsPath().Path);
573
+ WixAssert.StringEqual(@"candle.exe", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path);
574
575
var msiAssemblyNameSymbols = section.Symbols.OfType<MsiAssemblyNameSymbol>();
576
WixAssert.CompareLineByLine(new[]
@@ -626,8 +626,8 @@ namespace WixToolsetTest.CoreIntegration
626
var section = intermediate.Sections.Single();
627
628
var fileSymbol = section.Symbols.OfType<FileSymbol>().Single();
629
- Assert.Equal(Path.Combine(folder, @"data\candle.exe"), fileSymbol[FileSymbolFields.Source].AsPath().Path);
630
- Assert.Equal(@"candle.exe", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path);
629
+ WixAssert.StringEqual(Path.Combine(folder, @"data\candle.exe"), fileSymbol[FileSymbolFields.Source].AsPath().Path);
630
+ WixAssert.StringEqual(@"candle.exe", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path);
631
632
var msiAssemblyNameSymbols = section.Symbols.OfType<MsiAssemblyNameSymbol>();
633
WixAssert.CompareLineByLine(new[]
@@ -744,10 +744,10 @@ namespace WixToolsetTest.CoreIntegration
744
745
var output = WindowsInstallerData.Load(Path.Combine(baseFolder, @"bin\test.wixpdb"), false);
746
var caRows = output.Tables["CustomAction"].Rows.Single();
747
- Assert.Equal("SetINSTALLLOCATION", caRows.FieldAsString(0));
748
- Assert.Equal("51", caRows.FieldAsString(1));
749
- Assert.Equal("INSTALLLOCATION", caRows.FieldAsString(2));
750
- Assert.Equal("[INSTALLFOLDER]", caRows.FieldAsString(3));
747
+ WixAssert.StringEqual("SetINSTALLLOCATION", caRows.FieldAsString(0));
748
+ WixAssert.StringEqual("51", caRows.FieldAsString(1));
749
+ WixAssert.StringEqual("INSTALLLOCATION", caRows.FieldAsString(2));
750
+ WixAssert.StringEqual("[INSTALLFOLDER]", caRows.FieldAsString(3));
751
}
752
}
753
@@ -873,7 +873,7 @@ namespace WixToolsetTest.CoreIntegration
873
first =>
874
{
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
});
878
879
Assert.False(File.Exists(msiPath));
src/wix/test/WixToolsetTest.CoreIntegration/MsiTransactionFixture.cs
+6
-4
@@ -102,10 +102,12 @@ namespace WixToolsetTest.CoreIntegration
102
var extractResult = BundleExtractor.ExtractBAContainer(null, exePath, baFolderPath, extractFolderPath);
103
extractResult.AssertSuccess();
104
105
- var rollbackBoundaries = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:RollbackBoundary");
106
- Assert.Equal(2, rollbackBoundaries.Count);
107
- Assert.Equal("<RollbackBoundary Id='WixDefaultBoundary' Vital='yes' Transaction='no' />", rollbackBoundaries[0].GetTestXml());
108
- Assert.Equal("<RollbackBoundary Id='rba31DvS6_ninGllmavuS.cp4RYckk' Vital='yes' Transaction='yes' LogPathVariable='WixBundleLog_rba31DvS6_ninGllmavuS.cp4RYckk' />", rollbackBoundaries[1].GetTestXml());
105
+ var rollbackBoundaries = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:RollbackBoundary");
106
+ WixAssert.CompareLineByLine(new[]
107
+ {
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);
111
}
112
}
113
src/wix/test/WixToolsetTest.CoreIntegration/PackagePayloadFixture.cs
+14
-19
@@ -47,10 +47,7 @@ namespace WixToolsetTest.CoreIntegration
47
{
48
{ "ExePackage", new List<string> { "CacheId", "InstallSize", "Size" } },
49
};
50
- var msiPackageElements = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Chain/burn:MsiPackage")
51
- .Cast<XmlElement>()
52
- .Select(e => e.GetTestXml(ignoreAttributesByElementName))
53
- .ToArray();
50
+ var msiPackageElements = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/burn:MsiPackage", ignoreAttributesByElementName);
51
WixAssert.CompareLineByLine(new[]
52
{
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
65
"</MsiPackage>",
66
}, msiPackageElements);
67
71
- var packageElements = extractResult.SelectBADataNodes("/ba:BootstrapperApplicationData/ba:WixPackageProperties")
72
- .Cast<XmlElement>()
73
- .Select(e => e.GetTestXml())
74
- .ToArray();
75
- WixAssert.CompareLineByLine(new []
68
+ var packageElements = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixPackageProperties");
69
+ WixAssert.CompareLineByLine(new[]
70
{
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' />",
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' />",
73
}, packageElements);
74
81
- var featureElements = extractResult.SelectBADataNodes("/ba:BootstrapperApplicationData/ba:WixPackageFeatureInfo")
82
- .Cast<XmlElement>()
83
- .Select(e => e.GetTestXml())
84
- .ToArray();
75
+ var featureElements = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixPackageFeatureInfo");
76
WixAssert.CompareLineByLine(new[]
77
{
78
"<WixPackageFeatureInfo Package='MsiWithFeatures' Feature='ProductFeature' Size='34' Display='2' Level='1' Directory='' Attributes='0' />",
@@ -120,17 +111,21 @@ namespace WixToolsetTest.CoreIntegration
111
var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath);
112
extractResult.AssertSuccess();
113
123
- var exePackageElements = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Chain/burn:ExePackage");
114
var ignoreAttributesByElementName = new Dictionary<string, List<string>>
115
{
116
{ "ExePackage", new List<string> { "CacheId", "InstallSize", "Size" } },
117
};
128
- Assert.Equal(1, exePackageElements.Count);
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));
118
+ var exePackageElements = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/burn:ExePackage", 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);
123
131
- var payloadElements = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Payload[@Id='burn.exe']");
132
- Assert.Equal(1, payloadElements.Count);
133
- Assert.Equal("<Payload Id='burn.exe' FilePath='burn.exe' FileSize='463360' Hash='F6E722518AC3AB7E31C70099368D5770788C179AA23226110DCF07319B1E1964E246A1E8AE72E2CF23E0138AFC281BAFDE45969204405E114EB20C8195DA7E5E' Packaging='embedded' SourcePath='a0' Container='WixAttachedContainer' />", payloadElements[0].GetTestXml());
124
+ var payloadElements = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Payload[@Id='burn.exe']");
125
+ WixAssert.CompareLineByLine(new[]
126
+ {
127
+ "<Payload Id='burn.exe' FilePath='burn.exe' FileSize='463360' Hash='F6E722518AC3AB7E31C70099368D5770788C179AA23226110DCF07319B1E1964E246A1E8AE72E2CF23E0138AFC281BAFDE45969204405E114EB20C8195DA7E5E' Packaging='embedded' SourcePath='a0' Container='WixAttachedContainer' />",
128
+ }, payloadElements);
129
}
130
}
131
src/wix/test/WixToolsetTest.CoreIntegration/PatchFixture.cs
+9
-13
@@ -40,7 +40,7 @@ namespace WixToolsetTest.CoreIntegration
40
Assert.True(File.Exists(update1Pdb));
41
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
45
var names = Query.GetSubStorageNames(patchPath);
46
WixAssert.CompareLineByLine(new[] { "#RTM.1", "RTM.1" }, names);
@@ -72,7 +72,7 @@ namespace WixToolsetTest.CoreIntegration
72
Assert.True(File.Exists(update1Pdb));
73
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
77
var names = Query.GetSubStorageNames(patchPath);
78
WixAssert.CompareLineByLine(new[] { "#RTM.1", "RTM.1" }, names);
@@ -158,9 +158,11 @@ namespace WixToolsetTest.CoreIntegration
158
var doc = new XmlDocument();
159
doc.LoadXml(manifestData);
160
var nsmgr = BundleExtractor.GetBurnNamespaceManager(doc, "w");
161
- var slipstreamMspNodes = doc.SelectNodes("/w:BurnManifest/w:Chain/w:MsiPackage/w:SlipstreamMsp", nsmgr);
162
- Assert.Equal(1, slipstreamMspNodes.Count);
163
- Assert.Equal("<SlipstreamMsp Id='PatchA' />", slipstreamMspNodes[0].GetTestXml());
161
+ var slipstreamMspNodes = doc.SelectNodes("/w:BurnManifest/w:Chain/w:MsiPackage/w:SlipstreamMsp", nsmgr).GetTestXmlLines();
162
+ WixAssert.CompareLineByLine(new[]
163
+ {
164
+ "<SlipstreamMsp Id='PatchA' />",
165
+ }, slipstreamMspNodes);
166
}
167
}
168
}
@@ -173,15 +175,9 @@ namespace WixToolsetTest.CoreIntegration
175
var doc = new XmlDocument();
176
doc.LoadXml(manifestData);
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();
179
178
- var actual = new List<string>();
179
- foreach (XmlNode patchTargetCodeNode in patchTargetCodes)
180
- {
181
- actual.Add(patchTargetCodeNode.GetTestXml());
182
- }
183
-
184
- WixAssert.CompareLineByLine(expected, actual.ToArray());
180
+ WixAssert.CompareLineByLine(expected, patchTargetCodes);
181
}
182
}
183
src/wix/test/WixToolsetTest.CoreIntegration/PayloadFixture.cs
+9
-14
@@ -2,6 +2,7 @@
2
3
namespace WixToolsetTest.CoreIntegration
4
{
5
+ using System;
6
using System.Collections.Generic;
7
using System.IO;
8
using System.Linq;
@@ -47,7 +48,7 @@ namespace WixToolsetTest.CoreIntegration
48
? field.AsNullableNumber()?.ToString()
49
: field?.AsString())
50
.ToList();
50
- Assert.Equal(@"dir\file.ext", fields[(int)WixBundlePayloadSymbolFields.Name]);
51
+ WixAssert.StringEqual(@"dir\file.ext", fields[(int)WixBundlePayloadSymbolFields.Name]);
52
}
53
}
54
@@ -84,7 +85,7 @@ namespace WixToolsetTest.CoreIntegration
85
? field.AsNullableNumber()?.ToString()
86
: field?.AsString())
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]);
89
}
90
}
91
@@ -107,7 +108,7 @@ namespace WixToolsetTest.CoreIntegration
108
"-o", wixlibPath,
109
});
110
110
- Assert.InRange(result.ExitCode, 2, int.MaxValue);
111
+ Assert.InRange(result.ExitCode, 2, Int32.MaxValue);
112
113
var expectedIllegalRelativeLongFileName = 1;
114
var expectedPayloadMustBeRelativeToCache = 2;
@@ -168,7 +169,7 @@ namespace WixToolsetTest.CoreIntegration
169
170
result.AssertSuccess();
171
171
- WixAssert.CompareLineByLine(new string[]
172
+ WixAssert.CompareLineByLine(new[]
173
{
174
"The Payload 'burn.exe' is being added to Container 'PackagesContainer', overriding its Compressed value of 'no'.",
175
}, result.Messages.Select(m => m.ToString()).ToArray());
@@ -183,11 +184,8 @@ namespace WixToolsetTest.CoreIntegration
184
{ "Container", new List<string> { "FileSize", "Hash" } },
185
{ "Payload", new List<string> { "FileSize", "Hash" } },
186
};
186
- var payloads = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Payload")
187
- .Cast<XmlElement>()
188
- .Select(e => e.GetTestXml(ignoreAttributesByElementName))
189
- .ToArray();
190
- WixAssert.CompareLineByLine(new string[]
187
+ var payloads = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Payload", ignoreAttributesByElementName);
188
+ WixAssert.CompareLineByLine(new[]
189
{
190
"<Payload Id='burn.exe' FilePath='burn.exe' FileSize='*' Hash='*' Packaging='embedded' SourcePath='a0' Container='PackagesContainer' />",
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
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' />",
195
}, payloads);
196
199
- var containers = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Container")
200
- .Cast<XmlElement>()
201
- .Select(e => e.GetTestXml(ignoreAttributesByElementName))
202
- .ToArray();
203
- WixAssert.CompareLineByLine(new string[]
197
+ var containers = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Container", ignoreAttributesByElementName);
198
+ WixAssert.CompareLineByLine(new[]
199
{
200
"<Container Id='PackagesContainer' FileSize='*' Hash='*' DownloadUrl='http://example.com/id/PackagesContainer/packages.cab' FilePath='packages.cab' />",
201
}, containers);
src/wix/test/WixToolsetTest.CoreIntegration/PreprocessorFixture.cs
+3
-3
@@ -34,10 +34,10 @@ namespace WixToolsetTest.CoreIntegration
34
35
var includedFile = result.IncludedFiles.Single();
36
Assert.NotNull(result.Document);
37
- Assert.Equal(includeFile, includedFile.Path);
38
- Assert.Equal(sourcePath, includedFile.SourceLineNumbers.FileName);
37
+ WixAssert.StringEqual(includeFile, includedFile.Path);
38
+ WixAssert.StringEqual(sourcePath, includedFile.SourceLineNumbers.FileName);
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);
42
}
43
src/wix/test/WixToolsetTest.CoreIntegration/RegistryFixture.cs
-3
@@ -2,11 +2,8 @@
2
3
namespace WixToolsetTest.CoreIntegration
4
{
5
- using System;
6
- using System.Collections.Generic;
5
using System.IO;
6
using System.Linq;
9
- using System.Text;
7
using WixBuildTools.TestSupport;
8
using WixToolset.Core.TestPackage;
9
using WixToolset.Data;
src/wix/test/WixToolsetTest.CoreIntegration/RollbackBoundaryFixture.cs
+4
-10
@@ -111,11 +111,8 @@ namespace WixToolsetTest.CoreIntegration
111
var extractResult = BundleExtractor.ExtractBAContainer(null, exePath, baFolderPath, extractFolderPath);
112
extractResult.AssertSuccess();
113
114
- var rollbackBoundaries = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:RollbackBoundary")
115
- .Cast<XmlElement>()
116
- .Select(e => e.GetTestXml())
117
- .ToArray();
118
- WixAssert.CompareLineByLine(new string[]
114
+ var rollbackBoundaries = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:RollbackBoundary");
115
+ WixAssert.CompareLineByLine(new[]
116
{
117
"<RollbackBoundary Id='First' Vital='yes' Transaction='no' />",
118
}, rollbackBoundaries);
@@ -124,11 +121,8 @@ namespace WixToolsetTest.CoreIntegration
121
{
122
{ "MsiPackage", new List<string> { "Size" } },
123
};
127
- var chainPackages = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Chain/*")
128
- .Cast<XmlElement>()
129
- .Select(e => e.GetTestXml(ignoreAttributesByElementName))
130
- .ToArray();
131
- WixAssert.CompareLineByLine(new string[]
124
+ var chainPackages = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/*", ignoreAttributesByElementName);
125
+ WixAssert.CompareLineByLine(new[]
126
{
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}'>" +
128
"<MsiProperty Id='ARPSYSTEMCOMPONENT' Value='1' />" +
src/wix/test/WixToolsetTest.CoreIntegration/SoftwareTagFixture.cs
+2
-2
@@ -93,8 +93,8 @@ namespace WixToolsetTest.CoreIntegration
93
94
private static void Build(string[] args)
95
{
96
- var result = WixRunner.Execute(args)
97
- .AssertSuccess();
96
+ var result = WixRunner.Execute(args);
97
+ result.AssertSuccess();
98
}
99
}
100
}
src/wix/test/WixToolsetTest.CoreIntegration/TestXmlFixture.cs
+6
-5
@@ -3,6 +3,7 @@
3
namespace WixToolsetTest.CoreIntegration
4
{
5
using System.Collections.Generic;
6
+ using WixBuildTools.TestSupport;
7
using WixToolset.Core.TestPackage;
8
using Xunit;
9
@@ -19,7 +20,7 @@ namespace WixToolsetTest.CoreIntegration
20
</Top>";
21
var expected = "<Top One='f'><First Two='t'><Target One='*' Two='*' Three='c' /></First><Target One='*' Two='*' Three='y' /></Top>";
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));
24
}
25
26
[Fact]
@@ -27,7 +28,7 @@ namespace WixToolsetTest.CoreIntegration
28
{
29
var original = "<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());
32
}
33
34
[Fact]
@@ -35,7 +36,7 @@ namespace WixToolsetTest.CoreIntegration
36
{
37
var original = "<Test xmlns='a'><Child xmlns:b='b'><Grandchild xmlns:c='c' /><Grandchild /></Child></Test>";
38
var expected = "<Test><Child><Grandchild /><Grandchild /></Child></Test>";
38
- Assert.Equal(expected, original.GetTestXml());
39
+ WixAssert.StringEqual(expected, original.GetTestXml());
40
}
41
42
[Fact]
@@ -48,7 +49,7 @@ namespace WixToolsetTest.CoreIntegration
49
</Child>
50
</Test>";
51
var expected = "<Test><Child><Grandchild /><Grandchild /></Child></Test>";
51
- Assert.Equal(expected, original.GetTestXml());
52
+ WixAssert.StringEqual(expected, original.GetTestXml());
53
}
54
55
[Fact]
@@ -56,7 +57,7 @@ namespace WixToolsetTest.CoreIntegration
57
{
58
var original = "<?xml version='1.0'?><Test />";
59
var expected = "<Test />";
59
- Assert.Equal(expected, original.GetTestXml());
60
+ WixAssert.StringEqual(expected, original.GetTestXml());
61
}
62
}
63
}
src/wix/test/WixToolsetTest.CoreIntegration/TransformFixture.cs
+2
-2
@@ -120,10 +120,10 @@ namespace WixToolsetTest.CoreIntegration
120
}, rows.Keys.OrderBy(s => s).ToArray());
121
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
125
Assert.True(rows.TryGetValue("ProductLanguage", out var productLanguageRow));
126
- Assert.Equal("1041", productLanguageRow.FieldAsString(1));
126
+ WixAssert.StringEqual("1041", productLanguageRow.FieldAsString(1));
127
128
Assert.False(File.Exists(mstPath));
129
src/wix/test/WixToolsetTest.CoreIntegration/UpgradeFixture.cs
+7
-2
@@ -34,8 +34,13 @@ namespace WixToolsetTest.CoreIntegration
34
"-o", msiPath
35
});
36
37
- var message = result.Messages.Single(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());
37
+ var errorMessages = result.Messages.Where(m => m.Level == MessageLevel.Error)
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);
44
Assert.Equal(242, result.ExitCode);
45
}
46
}
src/wix/test/WixToolsetTest.CoreIntegration/VariableResolverFixture.cs
+10
-9
@@ -4,6 +4,7 @@
4
namespace WixToolsetTest.CoreIntegration
5
{
6
using System.Collections.Generic;
7
+ using WixBuildTools.TestSupport;
8
using WixToolset.Core;
9
using WixToolset.Data;
10
using WixToolset.Data.Bind;
@@ -30,23 +31,23 @@ namespace WixToolsetTest.CoreIntegration
31
variableResolver.AddLocalization(localization);
32
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);
35
Assert.False(result.UpdatedValue);
36
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);
39
Assert.True(result.UpdatedValue);
40
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);
43
Assert.True(result.UpdatedValue);
44
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);
47
Assert.True(result.UpdatedValue);
48
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);
51
Assert.False(result.UpdatedValue);
52
Assert.True(result.DelayedResolve);
53
@@ -54,20 +55,20 @@ namespace WixToolsetTest.CoreIntegration
55
Assert.Throws<WixException>(() => variableResolver.ResolveVariables(null, withUnknownLocString));
56
57
result = variableResolver.ResolveVariables(null, withUnknownLocString, errorOnUnknown: false);
57
- Assert.Equal(withUnknownLocString, result.Value);
58
+ WixAssert.StringEqual(withUnknownLocString, result.Value);
59
Assert.False(result.UpdatedValue);
60
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);
63
Assert.True(result.UpdatedValue);
64
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);
67
Assert.True(result.UpdatedValue);
68
Assert.True(result.DelayedResolve);
69
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);
72
Assert.True(result.UpdatedValue);
73
Assert.True(result.DelayedResolve);
74
}
src/wix/test/WixToolsetTest.CoreIntegration/VersionFixture.cs
+9
-4
@@ -33,8 +33,13 @@ namespace WixToolsetTest.CoreIntegration
33
"-o", msiPath
34
});
35
36
- var message = result.Messages.Single(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());
36
+ var errorMessages = result.Messages.Where(m => m.Level == MessageLevel.Error)
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);
43
Assert.Equal(242, result.ExitCode);
44
}
45
}
@@ -79,7 +84,7 @@ namespace WixToolsetTest.CoreIntegration
84
85
var propertyTable = Query.QueryDatabase(msiPath, new[] { "Property" }).Select(r => r.Split('\t')).ToDictionary(r => r[0].Substring("Property:".Length), r => r[1]);
86
Assert.True(propertyTable.TryGetValue("ProductVersion", out var productVersion));
82
- Assert.Equal("255.255.65535", productVersion);
87
+ WixAssert.StringEqual("255.255.65535", productVersion);
88
89
var extractResult = BundleExtractor.ExtractAllContainers(null, bundlePath, Path.Combine(baseFolder, "ba"), Path.Combine(baseFolder, "attached"), Path.Combine(baseFolder, "extract"));
90
extractResult.AssertSuccess();
@@ -87,7 +92,7 @@ namespace WixToolsetTest.CoreIntegration
92
var bundleVersion = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Registration/@Version")
93
.Cast<XmlAttribute>()
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);
96
}
97
}
98
}
src/wix/test/WixToolsetTest.CoreIntegration/WixiplFixture.cs
+8
-8
@@ -63,8 +63,8 @@ namespace WixToolsetTest.CoreIntegration
63
var section = intermediate.Sections.Single();
64
65
var fileSymbol = section.Symbols.OfType<FileSymbol>().First();
66
- Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path);
67
- Assert.Equal(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path);
66
+ WixAssert.StringEqual(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path);
67
+ WixAssert.StringEqual(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path);
68
}
69
}
70
@@ -133,8 +133,8 @@ namespace WixToolsetTest.CoreIntegration
133
134
{
135
var fileSymbol = section.Symbols.OfType<FileSymbol>().Single();
136
- Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path);
137
- Assert.Equal(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path);
136
+ WixAssert.StringEqual(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path);
137
+ WixAssert.StringEqual(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path);
138
}
139
140
{
@@ -142,7 +142,7 @@ namespace WixToolsetTest.CoreIntegration
142
var path = binary[BinarySymbolFields.Data].AsPath().Path;
143
Assert.StartsWith(Path.Combine(baseFolder, @"obj\Example.Extension"), path);
144
Assert.EndsWith(@"wix-ir\example.txt", path);
145
- Assert.Equal(@"BinFromWir", binary.Id.Id);
145
+ WixAssert.StringEqual(@"BinFromWir", binary.Id.Id);
146
}
147
}
148
}
@@ -188,8 +188,8 @@ namespace WixToolsetTest.CoreIntegration
188
189
{
190
var fileSymbol = section.Symbols.OfType<FileSymbol>().Single();
191
- Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path);
192
- Assert.Equal(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path);
191
+ WixAssert.StringEqual(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path);
192
+ WixAssert.StringEqual(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path);
193
}
194
195
{
@@ -197,7 +197,7 @@ namespace WixToolsetTest.CoreIntegration
197
var path = binary[BinarySymbolFields.Data].AsPath().Path;
198
Assert.StartsWith(Path.Combine(baseFolder, @"obj\test"), path);
199
Assert.EndsWith(@"wix-ir\example.txt", path);
200
- Assert.Equal(@"BinFromWir", binary.Id.Id);
200
+ WixAssert.StringEqual(@"BinFromWir", binary.Id.Id);
201
}
202
}
203
}
src/wix/test/WixToolsetTest.CoreIntegration/WixlibFixture.cs
+12
-12
@@ -182,8 +182,8 @@ namespace WixToolsetTest.CoreIntegration
182
var section = intermediate.Sections.Single();
183
184
var wixFile = section.Symbols.OfType<FileSymbol>().First();
185
- Assert.Equal(Path.Combine(folder, @"data\test.txt"), wixFile[FileSymbolFields.Source].AsPath().Path);
186
- Assert.Equal(@"test.txt", wixFile[FileSymbolFields.Source].PreviousValue.AsPath().Path);
185
+ WixAssert.StringEqual(Path.Combine(folder, @"data\test.txt"), wixFile[FileSymbolFields.Source].AsPath().Path);
186
+ WixAssert.StringEqual(@"test.txt", wixFile[FileSymbolFields.Source].PreviousValue.AsPath().Path);
187
}
188
}
189
@@ -240,7 +240,7 @@ namespace WixToolsetTest.CoreIntegration
240
var section = intermediate.Sections.Single();
241
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
}
245
}
246
@@ -284,12 +284,12 @@ namespace WixToolsetTest.CoreIntegration
284
var section = intermediate.Sections.Single();
285
286
var fileSymbol = section.Symbols.OfType<FileSymbol>().Single();
287
- Assert.Equal(Path.Combine(folder, @"data\example.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path);
288
- Assert.Equal(@"example.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path);
287
+ WixAssert.StringEqual(Path.Combine(folder, @"data\example.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path);
288
+ WixAssert.StringEqual(@"example.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path);
289
290
var example = section.Symbols.Where(t => t.Definition.Type == SymbolDefinitionType.MustBeFromAnExtension).Single();
291
- Assert.Equal("Foo", example.Id?.Id);
292
- Assert.Equal("Bar", example[1].AsString());
291
+ WixAssert.StringEqual("Foo", example.Id?.Id);
292
+ WixAssert.StringEqual("Bar", example[1].AsString());
293
}
294
}
295
@@ -345,13 +345,13 @@ namespace WixToolsetTest.CoreIntegration
345
var section = intermediate.Sections.Single();
346
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);
349
- Assert.Equal(@"example.txt", fileSymbols[0][FileSymbolFields.Source].PreviousValue.AsPath().Path);
350
- Assert.Equal(Path.Combine(folder, @"data\other.txt"), fileSymbols[1][FileSymbolFields.Source].AsPath().Path);
351
- Assert.Equal(@"other.txt", fileSymbols[1][FileSymbolFields.Source].PreviousValue.AsPath().Path);
348
+ WixAssert.StringEqual(Path.Combine(folder, @"data\example.txt"), fileSymbols[0][FileSymbolFields.Source].AsPath().Path);
349
+ WixAssert.StringEqual(@"example.txt", fileSymbols[0][FileSymbolFields.Source].PreviousValue.AsPath().Path);
350
+ WixAssert.StringEqual(Path.Combine(folder, @"data\other.txt"), fileSymbols[1][FileSymbolFields.Source].AsPath().Path);
351
+ WixAssert.StringEqual(@"other.txt", fileSymbols[1][FileSymbolFields.Source].PreviousValue.AsPath().Path);
352
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());
356
WixAssert.CompareLineByLine(new[] { "Bar", "Value" }, examples.Select(t => t[1].AsString()).ToArray());
357
}
src/wix/test/WixToolsetTest.Sdk/MsbuildFixture.cs
+1
-1
@@ -399,7 +399,7 @@ namespace WixToolsetTest.Sdk
399
var path = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories)
400
.Select(s => s.Substring(baseFolder.Length + 1))
401
.Single();
402
- Assert.Equal(@"bin\x86\Release\MsiPackage.wixipl", path);
402
+ WixAssert.StringEqual(@"bin\x86\Release\MsiPackage.wixipl", path);
403
}
404
}
405
src/wix/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs
+3
-3
@@ -66,7 +66,7 @@ namespace WixToolsetTest.Sdk
66
var section = intermediate.Sections.Single();
67
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
}
71
}
72
@@ -142,8 +142,8 @@ namespace WixToolsetTest.Sdk
142
var section = intermediate.Sections.Single();
143
144
var fileSymbols = section.Symbols.OfType<FileSymbol>().ToArray();
145
- Assert.Equal(@"SourceDir\MyProgram.txt", fileSymbols[0][FileSymbolFields.Source].PreviousValue.AsPath()?.Path);
146
- Assert.Equal(@"SourceDir\MyProgram.json", fileSymbols[1][FileSymbolFields.Source].PreviousValue.AsPath()?.Path);
145
+ WixAssert.StringEqual(@"SourceDir\MyProgram.txt", fileSymbols[0][FileSymbolFields.Source].PreviousValue.AsPath()?.Path);
146
+ WixAssert.StringEqual(@"SourceDir\MyProgram.json", fileSymbols[1][FileSymbolFields.Source].PreviousValue.AsPath()?.Path);
147
}
148
}
149