diff options
Diffstat (limited to 'src/wix/test/WixToolsetTest.Converters/UtilExtensionFixture.cs')
| -rw-r--r-- | src/wix/test/WixToolsetTest.Converters/UtilExtensionFixture.cs | 69 |
1 files changed, 68 insertions, 1 deletions
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 | { |
