diff options
Diffstat (limited to 'src/wix/test/WixToolsetTest.Converters')
-rw-r--r-- | src/wix/test/WixToolsetTest.Converters/ConditionFixture.cs | 306 | ||||
-rw-r--r-- | src/wix/test/WixToolsetTest.Converters/UtilExtensionFixture.cs | 69 |
2 files changed, 359 insertions, 16 deletions
diff --git a/src/wix/test/WixToolsetTest.Converters/ConditionFixture.cs b/src/wix/test/WixToolsetTest.Converters/ConditionFixture.cs index daf66a8b..c9fecc94 100644 --- a/src/wix/test/WixToolsetTest.Converters/ConditionFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/ConditionFixture.cs | |||
@@ -35,13 +35,55 @@ namespace WixToolsetTest.Converters | |||
35 | " <Fragment>", | 35 | " <Fragment>", |
36 | " <UI>", | 36 | " <UI>", |
37 | " <Dialog Id=\"Dlg1\">", | 37 | " <Dialog Id=\"Dlg1\">", |
38 | " <Control Id=\"Control1\" DisableCondition=\"x=y\" HideCondition=\"a<>b\">", | 38 | " <Control Id=\"Control1\" DisableCondition=\"x=y\" HideCondition=\"a<>b\" />", |
39 | " ", | 39 | " </Dialog>", |
40 | " ", | 40 | " </UI>", |
41 | " </Fragment>", | ||
42 | "</Wix>" | ||
43 | }; | ||
44 | |||
45 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | ||
46 | |||
47 | var messaging = new MockMessaging(); | ||
48 | var converter = new WixConverter(messaging, 2, null, null); | ||
49 | |||
50 | var errors = converter.ConvertDocument(document); | ||
51 | Assert.Equal(4, errors); | ||
52 | |||
53 | var actualLines = UnformattedDocumentLines(document); | ||
54 | WixAssert.CompareLineByLine(expected, actualLines); | ||
55 | } | ||
56 | |||
57 | [Fact] | ||
58 | public void FixControlConditionWithComment() | ||
59 | { | ||
60 | var parse = String.Join(Environment.NewLine, | ||
61 | "<?xml version=\"1.0\" encoding=\"utf-16\"?>", | ||
62 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>", | ||
63 | " <Fragment>", | ||
64 | " <UI>", | ||
65 | " <Dialog Id='Dlg1'>", | ||
66 | " <Control Id='Control1'>", | ||
67 | " <Condition Action='disable'><!-- Comment 1 -->x=y</Condition>", | ||
68 | " <Condition Action='hide'><!-- Comment 2 -->a<>b</Condition>", | ||
41 | " </Control>", | 69 | " </Control>", |
42 | " </Dialog>", | 70 | " </Dialog>", |
43 | " </UI>", | 71 | " </UI>", |
44 | " </Fragment>", | 72 | " </Fragment>", |
73 | "</Wix>"); | ||
74 | |||
75 | var expected = new[] | ||
76 | { | ||
77 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | ||
78 | " <Fragment>", | ||
79 | " <UI>", | ||
80 | " <Dialog Id=\"Dlg1\">", | ||
81 | " <!-- Comment 1 -->", | ||
82 | " <!-- Comment 2 -->", | ||
83 | " <Control Id=\"Control1\" DisableCondition=\"x=y\" HideCondition=\"a<>b\" />", | ||
84 | " </Dialog>", | ||
85 | " </UI>", | ||
86 | " </Fragment>", | ||
45 | "</Wix>" | 87 | "</Wix>" |
46 | }; | 88 | }; |
47 | 89 | ||
@@ -102,6 +144,53 @@ namespace WixToolsetTest.Converters | |||
102 | var actualLines = UnformattedDocumentLines(document); | 144 | var actualLines = UnformattedDocumentLines(document); |
103 | WixAssert.CompareLineByLine(expected, actualLines); | 145 | WixAssert.CompareLineByLine(expected, actualLines); |
104 | } | 146 | } |
147 | [Fact] | ||
148 | public void FixPublishConditionWithComment() | ||
149 | { | ||
150 | var parse = String.Join(Environment.NewLine, | ||
151 | "<?xml version=\"1.0\" encoding=\"utf-16\"?>", | ||
152 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>", | ||
153 | " <Fragment>", | ||
154 | " <UI>", | ||
155 | " <Dialog Id='Dlg1'>", | ||
156 | " <Control Id='Control1'>", | ||
157 | " <Publish Value='abc'><!-- Comment 1 -->1<2</Publish>", | ||
158 | " <Publish Value='gone'><!-- Comment 2 -->1</Publish>", | ||
159 | " </Control>", | ||
160 | " </Dialog>", | ||
161 | " </UI>", | ||
162 | " </Fragment>", | ||
163 | "</Wix>"); | ||
164 | |||
165 | var expected = new[] | ||
166 | { | ||
167 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | ||
168 | " <Fragment>", | ||
169 | " <UI>", | ||
170 | " <Dialog Id=\"Dlg1\">", | ||
171 | " <Control Id=\"Control1\">", | ||
172 | " <!-- Comment 1 -->", | ||
173 | " <Publish Value=\"abc\" Condition=\"1<2\" />", | ||
174 | " <!-- Comment 2 -->", | ||
175 | " <Publish Value=\"gone\" />", | ||
176 | " </Control>", | ||
177 | " </Dialog>", | ||
178 | " </UI>", | ||
179 | " </Fragment>", | ||
180 | "</Wix>" | ||
181 | }; | ||
182 | |||
183 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | ||
184 | |||
185 | var messaging = new MockMessaging(); | ||
186 | var converter = new WixConverter(messaging, 2, null, null); | ||
187 | |||
188 | var errors = converter.ConvertDocument(document); | ||
189 | Assert.Equal(5, errors); | ||
190 | |||
191 | var actualLines = UnformattedDocumentLines(document); | ||
192 | WixAssert.CompareLineByLine(expected, actualLines); | ||
193 | } | ||
105 | 194 | ||
106 | [Fact] | 195 | [Fact] |
107 | public void FixComponentCondition() | 196 | public void FixComponentCondition() |
@@ -120,10 +209,43 @@ namespace WixToolsetTest.Converters | |||
120 | { | 209 | { |
121 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | 210 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", |
122 | " <Fragment>", | 211 | " <Fragment>", |
123 | " <Component Id=\"Comp1\" Directory=\"ApplicationFolder\" Condition=\"1<2\">", | 212 | " <Component Id=\"Comp1\" Directory=\"ApplicationFolder\" Condition=\"1<2\" />", |
124 | " ", | 213 | " </Fragment>", |
214 | "</Wix>" | ||
215 | }; | ||
216 | |||
217 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | ||
218 | |||
219 | var messaging = new MockMessaging(); | ||
220 | var converter = new WixConverter(messaging, 2, null, null); | ||
221 | |||
222 | var errors = converter.ConvertDocument(document); | ||
223 | Assert.Equal(3, errors); | ||
224 | |||
225 | var actualLines = UnformattedDocumentLines(document); | ||
226 | WixAssert.CompareLineByLine(expected, actualLines); | ||
227 | } | ||
228 | |||
229 | [Fact] | ||
230 | public void FixComponentConditionWithComment() | ||
231 | { | ||
232 | var parse = String.Join(Environment.NewLine, | ||
233 | "<?xml version=\"1.0\" encoding=\"utf-16\"?>", | ||
234 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>", | ||
235 | " <Fragment>", | ||
236 | " <Component Id='Comp1' Directory='ApplicationFolder'>", | ||
237 | " <Condition><!-- Comment -->1<2</Condition>", | ||
125 | " </Component>", | 238 | " </Component>", |
126 | " </Fragment>", | 239 | " </Fragment>", |
240 | "</Wix>"); | ||
241 | |||
242 | var expected = new[] | ||
243 | { | ||
244 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | ||
245 | " <Fragment>", | ||
246 | " <!-- Comment -->", | ||
247 | " <Component Id=\"Comp1\" Directory=\"ApplicationFolder\" Condition=\"1<2\" />", | ||
248 | " </Fragment>", | ||
127 | "</Wix>" | 249 | "</Wix>" |
128 | }; | 250 | }; |
129 | 251 | ||
@@ -175,27 +297,24 @@ namespace WixToolsetTest.Converters | |||
175 | Assert.Equal(4, errors); | 297 | Assert.Equal(4, errors); |
176 | } | 298 | } |
177 | 299 | ||
178 | [Fact(Skip = "Test demonstrates failure")] | 300 | [Fact] |
179 | public void FixConditionWithComment() | 301 | public void FixConditionWithComment() |
180 | { | 302 | { |
181 | var parse = String.Join(Environment.NewLine, | 303 | var parse = String.Join(Environment.NewLine, |
182 | "<?xml version=\"1.0\" encoding=\"utf-16\"?>", | 304 | "<?xml version=\"1.0\" encoding=\"utf-16\"?>", |
183 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>", | 305 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>", |
184 | " <Fragment>", | 306 | " <Fragment>", |
185 | " <Condition Message='commented cdata'>", | 307 | " <Condition Message='commented cdata'><!-- commented conditional -->", |
186 | " <!-- commented condition -->", | 308 | "<![CDATA[cdatacontent]]></Condition>", |
187 | " <![CDATA[cdatacontent]]>", | ||
188 | " </Condition>", | ||
189 | " </Fragment>", | 309 | " </Fragment>", |
190 | "</Wix>"); | 310 | "</Wix>"); |
191 | 311 | ||
192 | //TODO: expected value is not set in stone but must have replaced Condition element with Launch and should have kept the comment. | ||
193 | var expected = new[] | 312 | var expected = new[] |
194 | { | 313 | { |
195 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | 314 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", |
196 | " <Fragment>", | 315 | " <Fragment>", |
316 | " <!-- commented conditional -->", | ||
197 | " <Launch Condition=\"cdatacontent\" Message=\"commented cdata\" />", | 317 | " <Launch Condition=\"cdatacontent\" Message=\"commented cdata\" />", |
198 | " <!-- commented condition -->", | ||
199 | " </Fragment>", | 318 | " </Fragment>", |
200 | "</Wix>" | 319 | "</Wix>" |
201 | }; | 320 | }; |
@@ -210,7 +329,7 @@ namespace WixToolsetTest.Converters | |||
210 | var actualLines = UnformattedDocumentLines(document); | 329 | var actualLines = UnformattedDocumentLines(document); |
211 | WixAssert.CompareLineByLine(expected, actualLines); | 330 | WixAssert.CompareLineByLine(expected, actualLines); |
212 | 331 | ||
213 | Assert.Equal(2, errors); | 332 | Assert.Equal(3, errors); |
214 | } | 333 | } |
215 | 334 | ||
216 | [Fact] | 335 | [Fact] |
@@ -285,6 +404,43 @@ namespace WixToolsetTest.Converters | |||
285 | } | 404 | } |
286 | 405 | ||
287 | [Fact] | 406 | [Fact] |
407 | public void FixFeatureConditionWithComment() | ||
408 | { | ||
409 | var parse = String.Join(Environment.NewLine, | ||
410 | "<?xml version=\"1.0\" encoding=\"utf-16\"?>", | ||
411 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>", | ||
412 | " <Fragment>", | ||
413 | " <Feature Id='Feature1'>", | ||
414 | " <Condition Level='0'><!-- Comment -->PROP = 1</Condition>", | ||
415 | " </Feature>", | ||
416 | " </Fragment>", | ||
417 | "</Wix>"); | ||
418 | |||
419 | var expected = new[] | ||
420 | { | ||
421 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | ||
422 | " <Fragment>", | ||
423 | " <Feature Id=\"Feature1\">", | ||
424 | " <!-- Comment -->", | ||
425 | " <Level Value=\"0\" Condition=\"PROP = 1\" />", | ||
426 | " </Feature>", | ||
427 | " </Fragment>", | ||
428 | "</Wix>" | ||
429 | }; | ||
430 | |||
431 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | ||
432 | |||
433 | var messaging = new MockMessaging(); | ||
434 | var converter = new WixConverter(messaging, 2, null, null); | ||
435 | |||
436 | var errors = converter.ConvertDocument(document); | ||
437 | Assert.Equal(3, errors); | ||
438 | |||
439 | var actualLines = UnformattedDocumentLines(document); | ||
440 | WixAssert.CompareLineByLine(expected, actualLines); | ||
441 | } | ||
442 | |||
443 | [Fact] | ||
288 | public void FixLaunchCondition() | 444 | public void FixLaunchCondition() |
289 | { | 445 | { |
290 | var parse = String.Join(Environment.NewLine, | 446 | var parse = String.Join(Environment.NewLine, |
@@ -323,6 +479,46 @@ namespace WixToolsetTest.Converters | |||
323 | } | 479 | } |
324 | 480 | ||
325 | [Fact] | 481 | [Fact] |
482 | public void FixLaunchConditionWithComment() | ||
483 | { | ||
484 | var parse = String.Join(Environment.NewLine, | ||
485 | "<?xml version=\"1.0\" encoding=\"utf-16\"?>", | ||
486 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>", | ||
487 | " <Fragment>", | ||
488 | " <Condition Message='Stop the install'>", | ||
489 | " <!-- Comment 1 -->1<2", | ||
490 | " </Condition>", | ||
491 | " <Condition Message='Do not stop'>", | ||
492 | " <!-- Comment 2 -->1=2", | ||
493 | " </Condition>", | ||
494 | " </Fragment>", | ||
495 | "</Wix>"); | ||
496 | |||
497 | var expected = new[] | ||
498 | { | ||
499 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | ||
500 | " <Fragment>", | ||
501 | " <!-- Comment 1 -->", | ||
502 | " <Launch Condition=\"1<2\" Message=\"Stop the install\" />", | ||
503 | " <!-- Comment 2 -->", | ||
504 | " <Launch Condition=\"1=2\" Message=\"Do not stop\" />", | ||
505 | " </Fragment>", | ||
506 | "</Wix>" | ||
507 | }; | ||
508 | |||
509 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | ||
510 | |||
511 | var messaging = new MockMessaging(); | ||
512 | var converter = new WixConverter(messaging, 2, null, null); | ||
513 | |||
514 | var errors = converter.ConvertDocument(document); | ||
515 | Assert.Equal(4, errors); | ||
516 | |||
517 | var actualLines = UnformattedDocumentLines(document); | ||
518 | WixAssert.CompareLineByLine(expected, actualLines); | ||
519 | } | ||
520 | |||
521 | [Fact] | ||
326 | public void FixLaunchConditionInProduct() | 522 | public void FixLaunchConditionInProduct() |
327 | { | 523 | { |
328 | var parse = String.Join(Environment.NewLine, | 524 | var parse = String.Join(Environment.NewLine, |
@@ -363,6 +559,48 @@ namespace WixToolsetTest.Converters | |||
363 | } | 559 | } |
364 | 560 | ||
365 | [Fact] | 561 | [Fact] |
562 | public void FixLaunchConditionInProductWithComment() | ||
563 | { | ||
564 | var parse = String.Join(Environment.NewLine, | ||
565 | "<?xml version=\"1.0\" encoding=\"utf-16\"?>", | ||
566 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>", | ||
567 | " <Product>", | ||
568 | " <Package />", | ||
569 | " <Condition Message='Stop the install'>", | ||
570 | " <!-- Comment 1 -->1<2", | ||
571 | " </Condition>", | ||
572 | " <Condition Message='Do not stop'>", | ||
573 | " <!-- Comment 2 -->1=2", | ||
574 | " </Condition>", | ||
575 | " </Product>", | ||
576 | "</Wix>"); | ||
577 | |||
578 | var expected = new[] | ||
579 | { | ||
580 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | ||
581 | " <Package Compressed=\"no\">", | ||
582 | " ", | ||
583 | " <!-- Comment 1 -->", | ||
584 | " <Launch Condition=\"1<2\" Message=\"Stop the install\" />", | ||
585 | " <!-- Comment 2 -->", | ||
586 | " <Launch Condition=\"1=2\" Message=\"Do not stop\" />", | ||
587 | " </Package>", | ||
588 | "</Wix>" | ||
589 | }; | ||
590 | |||
591 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | ||
592 | |||
593 | var messaging = new MockMessaging(); | ||
594 | var converter = new WixConverter(messaging, 2, null, null); | ||
595 | |||
596 | var errors = converter.ConvertDocument(document); | ||
597 | Assert.Equal(6, errors); | ||
598 | |||
599 | var actualLines = UnformattedDocumentLines(document); | ||
600 | WixAssert.CompareLineByLine(expected, actualLines); | ||
601 | } | ||
602 | |||
603 | [Fact] | ||
366 | public void FixPermissionExCondition() | 604 | public void FixPermissionExCondition() |
367 | { | 605 | { |
368 | var parse = String.Join(Environment.NewLine, | 606 | var parse = String.Join(Environment.NewLine, |
@@ -383,11 +621,49 @@ namespace WixToolsetTest.Converters | |||
383 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | 621 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", |
384 | " <Fragment>", | 622 | " <Fragment>", |
385 | " <Component Id=\"Comp1\" Directory=\"ApplicationFolder\">", | 623 | " <Component Id=\"Comp1\" Directory=\"ApplicationFolder\">", |
386 | " <PermissionEx Sddl=\"sddl\" Condition=\"1<2\">", | 624 | " <PermissionEx Sddl=\"sddl\" Condition=\"1<2\" />", |
387 | " ", | 625 | " </Component>", |
626 | " </Fragment>", | ||
627 | "</Wix>" | ||
628 | }; | ||
629 | |||
630 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | ||
631 | |||
632 | var messaging = new MockMessaging(); | ||
633 | var converter = new WixConverter(messaging, 2, null, null); | ||
634 | |||
635 | var errors = converter.ConvertDocument(document); | ||
636 | Assert.Equal(3, errors); | ||
637 | |||
638 | var actualLines = UnformattedDocumentLines(document); | ||
639 | WixAssert.CompareLineByLine(expected, actualLines); | ||
640 | } | ||
641 | |||
642 | [Fact] | ||
643 | public void FixPermissionExConditionWithComment() | ||
644 | { | ||
645 | var parse = String.Join(Environment.NewLine, | ||
646 | "<!-- Comment 1 -->", | ||
647 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>", | ||
648 | " <Fragment>", | ||
649 | " <Component Id='Comp1' Guid='*' Directory='ApplicationFolder'>", | ||
650 | " <PermissionEx Sddl='sddl'>", | ||
651 | " <Condition><!-- Comment 2 -->1<2</Condition>", | ||
388 | " </PermissionEx>", | 652 | " </PermissionEx>", |
389 | " </Component>", | 653 | " </Component>", |
390 | " </Fragment>", | 654 | " </Fragment>", |
655 | "</Wix>"); | ||
656 | |||
657 | var expected = new[] | ||
658 | { | ||
659 | "<!-- Comment 1 -->", | ||
660 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | ||
661 | " <Fragment>", | ||
662 | " <Component Id=\"Comp1\" Directory=\"ApplicationFolder\">", | ||
663 | " <!-- Comment 2 -->", | ||
664 | " <PermissionEx Sddl=\"sddl\" Condition=\"1<2\" />", | ||
665 | " </Component>", | ||
666 | " </Fragment>", | ||
391 | "</Wix>" | 667 | "</Wix>" |
392 | }; | 668 | }; |
393 | 669 | ||
diff --git a/src/wix/test/WixToolsetTest.Converters/UtilExtensionFixture.cs b/src/wix/test/WixToolsetTest.Converters/UtilExtensionFixture.cs index 10450c68..0f23d87b 100644 --- a/src/wix/test/WixToolsetTest.Converters/UtilExtensionFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/UtilExtensionFixture.cs | |||
@@ -45,6 +45,40 @@ namespace WixToolsetTest.Converters | |||
45 | } | 45 | } |
46 | 46 | ||
47 | [Fact] | 47 | [Fact] |
48 | public void FixCloseAppsConditionWithComment() | ||
49 | { | ||
50 | var parse = String.Join(Environment.NewLine, | ||
51 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi' xmlns:util='http://schemas.microsoft.com/wix/UtilExtension'>", | ||
52 | " <Fragment>", | ||
53 | " <util:CloseApplication Id='EndApp' Target='example.exe'>", | ||
54 | " <!-- Comment -->a<>b", | ||
55 | " </util:CloseApplication>", | ||
56 | " </Fragment>", | ||
57 | "</Wix>"); | ||
58 | |||
59 | var expected = new[] | ||
60 | { | ||
61 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\" xmlns:util=\"http://wixtoolset.org/schemas/v4/wxs/util\">", | ||
62 | " <Fragment>", | ||
63 | " <!-- Comment -->", | ||
64 | " <util:CloseApplication Id=\"EndApp\" Target=\"example.exe\" Condition=\"a<>b\" />", | ||
65 | " </Fragment>", | ||
66 | "</Wix>" | ||
67 | }; | ||
68 | |||
69 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | ||
70 | |||
71 | var messaging = new MockMessaging(); | ||
72 | var converter = new WixConverter(messaging, 2, null, null); | ||
73 | |||
74 | var errors = converter.ConvertDocument(document); | ||
75 | Assert.Equal(3, errors); | ||
76 | |||
77 | var actualLines = UnformattedDocumentLines(document); | ||
78 | WixAssert.CompareLineByLine(expected, actualLines); | ||
79 | } | ||
80 | |||
81 | [Fact] | ||
48 | public void FixXmlConfigValue() | 82 | public void FixXmlConfigValue() |
49 | { | 83 | { |
50 | var parse = String.Join(Environment.NewLine, | 84 | var parse = String.Join(Environment.NewLine, |
@@ -78,6 +112,40 @@ namespace WixToolsetTest.Converters | |||
78 | } | 112 | } |
79 | 113 | ||
80 | [Fact] | 114 | [Fact] |
115 | public void FixXmlConfigValueWithComment() | ||
116 | { | ||
117 | var parse = String.Join(Environment.NewLine, | ||
118 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi' xmlns:util='http://schemas.microsoft.com/wix/UtilExtension'>", | ||
119 | " <Fragment>", | ||
120 | " <util:XmlConfig Id='Change' ElementPath='book'>", | ||
121 | " <!-- Comment -->a<>b", | ||
122 | " </util:XmlConfig>", | ||
123 | " </Fragment>", | ||
124 | "</Wix>"); | ||
125 | |||
126 | var expected = new[] | ||
127 | { | ||
128 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\" xmlns:util=\"http://wixtoolset.org/schemas/v4/wxs/util\">", | ||
129 | " <Fragment>", | ||
130 | " <!-- Comment -->", | ||
131 | " <util:XmlConfig Id=\"Change\" ElementPath=\"book\" Value=\"a<>b\" />", | ||
132 | " </Fragment>", | ||
133 | "</Wix>" | ||
134 | }; | ||
135 | |||
136 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | ||
137 | |||
138 | var messaging = new MockMessaging(); | ||
139 | var converter = new WixConverter(messaging, 2, null, null); | ||
140 | |||
141 | var errors = converter.ConvertDocument(document); | ||
142 | Assert.Equal(3, errors); | ||
143 | |||
144 | var actualLines = UnformattedDocumentLines(document); | ||
145 | WixAssert.CompareLineByLine(expected, actualLines); | ||
146 | } | ||
147 | |||
148 | [Fact] | ||
81 | public void WarnsOnAllRegistryValueSearches() | 149 | public void WarnsOnAllRegistryValueSearches() |
82 | { | 150 | { |
83 | var parse = String.Join(Environment.NewLine, | 151 | var parse = String.Join(Environment.NewLine, |
@@ -112,7 +180,6 @@ namespace WixToolsetTest.Converters | |||
112 | WixAssert.CompareLineByLine(expected, actualLines); | 180 | WixAssert.CompareLineByLine(expected, actualLines); |
113 | } | 181 | } |
114 | 182 | ||
115 | |||
116 | [Fact] | 183 | [Fact] |
117 | public void FixXmlConfigValueCData() | 184 | public void FixXmlConfigValueCData() |
118 | { | 185 | { |