diff options
author | Bob Arnson <bob@firegiant.com> | 2021-04-23 17:50:54 -0400 |
---|---|---|
committer | Bob Arnson <bob@firegiant.com> | 2021-04-23 17:53:25 -0400 |
commit | 0177cb5b9b08351266816097ea9e8561b9ec0973 (patch) | |
tree | 7771810687a7469eb8770a642095ecbd456d0067 /src/test | |
parent | b0840f6ad872f7085fd8d62285dc889763a65968 (diff) | |
download | wix-0177cb5b9b08351266816097ea9e8561b9ec0973.tar.gz wix-0177cb5b9b08351266816097ea9e8561b9ec0973.tar.bz2 wix-0177cb5b9b08351266816097ea9e8561b9ec0973.zip |
Fix for added elements to reference platform-specific extension custom actions.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/WixToolsetTest.Converters/ConverterIntegrationFixture.cs | 3 | ||||
-rw-r--r-- | src/test/WixToolsetTest.Converters/UtilExtensionFixture.cs | 75 |
2 files changed, 76 insertions, 2 deletions
diff --git a/src/test/WixToolsetTest.Converters/ConverterIntegrationFixture.cs b/src/test/WixToolsetTest.Converters/ConverterIntegrationFixture.cs index acd7991e..a39f6243 100644 --- a/src/test/WixToolsetTest.Converters/ConverterIntegrationFixture.cs +++ b/src/test/WixToolsetTest.Converters/ConverterIntegrationFixture.cs | |||
@@ -8,7 +8,6 @@ namespace WixToolsetTest.Converters | |||
8 | using WixBuildTools.TestSupport; | 8 | using WixBuildTools.TestSupport; |
9 | using WixToolset.Converters; | 9 | using WixToolset.Converters; |
10 | using WixToolset.Core; | 10 | using WixToolset.Core; |
11 | using WixToolset.Core.ExtensibilityServices; | ||
12 | using WixToolset.Core.TestPackage; | 11 | using WixToolset.Core.TestPackage; |
13 | using WixToolsetTest.Converters.Mocks; | 12 | using WixToolsetTest.Converters.Mocks; |
14 | using Xunit; | 13 | using Xunit; |
@@ -88,7 +87,7 @@ namespace WixToolsetTest.Converters | |||
88 | var converter = new WixConverter(messaging, 4); | 87 | var converter = new WixConverter(messaging, 4); |
89 | var errors = converter.ConvertFile(targetFile, true); | 88 | var errors = converter.ConvertFile(targetFile, true); |
90 | 89 | ||
91 | Assert.Equal(10, errors); | 90 | Assert.Single(messaging.Messages.Where(m => m.Id == 5/*WixConverter.ConverterTestType.UnauthorizedAccessException*/)); |
92 | } | 91 | } |
93 | } | 92 | } |
94 | 93 | ||
diff --git a/src/test/WixToolsetTest.Converters/UtilExtensionFixture.cs b/src/test/WixToolsetTest.Converters/UtilExtensionFixture.cs index 9964e3b0..10450c68 100644 --- a/src/test/WixToolsetTest.Converters/UtilExtensionFixture.cs +++ b/src/test/WixToolsetTest.Converters/UtilExtensionFixture.cs | |||
@@ -111,5 +111,80 @@ namespace WixToolsetTest.Converters | |||
111 | var actualLines = UnformattedDocumentLines(document); | 111 | var actualLines = UnformattedDocumentLines(document); |
112 | WixAssert.CompareLineByLine(expected, actualLines); | 112 | WixAssert.CompareLineByLine(expected, actualLines); |
113 | } | 113 | } |
114 | |||
115 | |||
116 | [Fact] | ||
117 | public void FixXmlConfigValueCData() | ||
118 | { | ||
119 | var parse = String.Join(Environment.NewLine, | ||
120 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi' xmlns:util='http://schemas.microsoft.com/wix/UtilExtension'>", | ||
121 | " <Fragment>", | ||
122 | " <util:XmlConfig Id='Change' ElementPath='book'>", | ||
123 | " <![CDATA[a<>b]]>", | ||
124 | " </util:XmlConfig>", | ||
125 | " </Fragment>", | ||
126 | "</Wix>"); | ||
127 | |||
128 | var expected = new[] | ||
129 | { | ||
130 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\" xmlns:util=\"http://wixtoolset.org/schemas/v4/wxs/util\">", | ||
131 | " <Fragment>", | ||
132 | " <util:XmlConfig Id=\"Change\" ElementPath=\"book\" Value=\"a<>b\" />", | ||
133 | " </Fragment>", | ||
134 | "</Wix>" | ||
135 | }; | ||
136 | |||
137 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | ||
138 | |||
139 | var messaging = new MockMessaging(); | ||
140 | var converter = new WixConverter(messaging, 2, null, null); | ||
141 | |||
142 | var errors = converter.ConvertDocument(document); | ||
143 | Assert.Equal(3, errors); | ||
144 | |||
145 | var actualLines = UnformattedDocumentLines(document); | ||
146 | WixAssert.CompareLineByLine(expected, actualLines); | ||
147 | } | ||
148 | |||
149 | [Fact] | ||
150 | public void FixQueryOsPropertyRefs() | ||
151 | { | ||
152 | var parse = String.Join(Environment.NewLine, | ||
153 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi' xmlns:util='http://schemas.microsoft.com/wix/UtilExtension'>", | ||
154 | " <Fragment>", | ||
155 | " <PropertyRef Id=\"WIX_SUITE_ENTERPRISE\" />", | ||
156 | " <PropertyRef Id=\"WIX_DIR_COMMON_DOCUMENTS\" />", | ||
157 | " <CustomActionRef Id=\"WixFailWhenDeferred\" />", | ||
158 | " <UI>", | ||
159 | " <PropertyRef Id=\"WIX_ACCOUNT_LOCALSERVICE\" />", | ||
160 | " </UI>", | ||
161 | " </Fragment>", | ||
162 | "</Wix>"); | ||
163 | |||
164 | var expected = new[] | ||
165 | { | ||
166 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\" xmlns:util=\"http://wixtoolset.org/schemas/v4/wxs/util\">", | ||
167 | " <Fragment>", | ||
168 | " <util:QueryWindowsSuiteInfo />", | ||
169 | " <util:QueryWindowsDirectories />", | ||
170 | " <util:FailWhenDeferred />", | ||
171 | " <UI>", | ||
172 | " <util:QueryWindowsWellKnownSIDs />", | ||
173 | " </UI>", | ||
174 | " </Fragment>", | ||
175 | "</Wix>" | ||
176 | }; | ||
177 | |||
178 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | ||
179 | |||
180 | var messaging = new MockMessaging(); | ||
181 | var converter = new WixConverter(messaging, 2, null, null); | ||
182 | |||
183 | var errors = converter.ConvertDocument(document); | ||
184 | Assert.Equal(6, errors); | ||
185 | |||
186 | var actualLines = UnformattedDocumentLines(document); | ||
187 | WixAssert.CompareLineByLine(expected, actualLines); | ||
188 | } | ||
114 | } | 189 | } |
115 | } | 190 | } |