diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2020-12-08 21:35:15 -0600 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2020-12-09 13:14:05 -0600 |
| commit | 7378de4301d4f8c2570b29268ca7affbdb5721c2 (patch) | |
| tree | 084bf59d501c763951f1b555a1605db8ce5fca85 /src/test | |
| parent | 05cafee83e597badaf842bd7e6ba06f4d8fe193f (diff) | |
| download | wix-7378de4301d4f8c2570b29268ca7affbdb5721c2.tar.gz wix-7378de4301d4f8c2570b29268ca7affbdb5721c2.tar.bz2 wix-7378de4301d4f8c2570b29268ca7affbdb5721c2.zip | |
Add conversion for built-in BA usage from BootstrapperApplicationRef.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/WixToolsetTest.Converters/BootstrapperApplicationFixture.cs | 204 |
1 files changed, 204 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.Converters/BootstrapperApplicationFixture.cs b/src/test/WixToolsetTest.Converters/BootstrapperApplicationFixture.cs index dc5bae00..60386470 100644 --- a/src/test/WixToolsetTest.Converters/BootstrapperApplicationFixture.cs +++ b/src/test/WixToolsetTest.Converters/BootstrapperApplicationFixture.cs | |||
| @@ -47,6 +47,210 @@ namespace WixToolsetTest.Converters | |||
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | [Fact] | 49 | [Fact] |
| 50 | public void ConvertDotNetCoreBootstrapperApplicationRefWithExistingElement() | ||
| 51 | { | ||
| 52 | var parse = String.Join(Environment.NewLine, | ||
| 53 | "<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs' xmlns:bal='http://wixtoolset.org/schemas/v4/wxs/bal'>", | ||
| 54 | " <Fragment>", | ||
| 55 | " <BootstrapperApplicationRef Id='DotNetCoreBootstrapperApplicationHost.Minimal'>", | ||
| 56 | " <bal:WixDotNetCoreBootstrapperApplication SelfContainedDeployment='yes' />", | ||
| 57 | " </BootstrapperApplicationRef>", | ||
| 58 | " </Fragment>", | ||
| 59 | "</Wix>"); | ||
| 60 | |||
| 61 | var expected = new[] | ||
| 62 | { | ||
| 63 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\" xmlns:bal=\"http://wixtoolset.org/schemas/v4/wxs/bal\">", | ||
| 64 | " <Fragment>", | ||
| 65 | " <BootstrapperApplication>", | ||
| 66 | " <bal:WixDotNetCoreBootstrapperApplicationHost SelfContainedDeployment=\"yes\" Theme=\"none\" />", | ||
| 67 | " </BootstrapperApplication>", | ||
| 68 | " </Fragment>", | ||
| 69 | "</Wix>" | ||
| 70 | }; | ||
| 71 | |||
| 72 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | ||
| 73 | |||
| 74 | var messaging = new MockMessaging(); | ||
| 75 | var converter = new WixConverter(messaging, 2, null, null); | ||
| 76 | |||
| 77 | var errors = converter.ConvertDocument(document); | ||
| 78 | Assert.Equal(1, errors); | ||
| 79 | |||
| 80 | var actualLines = UnformattedDocumentLines(document); | ||
| 81 | WixAssert.CompareLineByLine(expected, actualLines); | ||
| 82 | } | ||
| 83 | |||
| 84 | [Fact] | ||
| 85 | public void ConvertDotNetCoreBootstrapperApplicationRefWithoutExistingElement() | ||
| 86 | { | ||
| 87 | var parse = String.Join(Environment.NewLine, | ||
| 88 | "<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs' xmlns:bal='http://wixtoolset.org/schemas/v4/wxs/bal'>", | ||
| 89 | " <Fragment>", | ||
| 90 | " <BootstrapperApplicationRef Id='DotNetCoreBootstrapperApplicationHost' />", | ||
| 91 | " </Fragment>", | ||
| 92 | "</Wix>"); | ||
| 93 | |||
| 94 | var expected = new[] | ||
| 95 | { | ||
| 96 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\" xmlns:bal=\"http://wixtoolset.org/schemas/v4/wxs/bal\">", | ||
| 97 | " <Fragment>", | ||
| 98 | " <BootstrapperApplication>", | ||
| 99 | "<bal:WixDotNetCoreBootstrapperApplicationHost />", | ||
| 100 | "</BootstrapperApplication>", | ||
| 101 | " </Fragment>", | ||
| 102 | "</Wix>" | ||
| 103 | }; | ||
| 104 | |||
| 105 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | ||
| 106 | |||
| 107 | var messaging = new MockMessaging(); | ||
| 108 | var converter = new WixConverter(messaging, 2, null, null); | ||
| 109 | |||
| 110 | var errors = converter.ConvertDocument(document); | ||
| 111 | Assert.Equal(1, errors); | ||
| 112 | |||
| 113 | var actualLines = UnformattedDocumentLines(document); | ||
| 114 | WixAssert.CompareLineByLine(expected, actualLines); | ||
| 115 | } | ||
| 116 | |||
| 117 | [Fact] | ||
| 118 | public void ConvertFrameworkBootstrapperApplicationRefWithExistingElement() | ||
| 119 | { | ||
| 120 | var parse = String.Join(Environment.NewLine, | ||
| 121 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi' xmlns:bal='http://schemas.microsoft.com/wix/BalExtension'>", | ||
| 122 | " <Fragment>", | ||
| 123 | " <BootstrapperApplicationRef Id='ManagedBootstrapperApplicationHost'>", | ||
| 124 | " <bal:WixManagedBootstrapperApplicationHost LogoFile='logo.png' />", | ||
| 125 | " </BootstrapperApplicationRef>", | ||
| 126 | " </Fragment>", | ||
| 127 | "</Wix>"); | ||
| 128 | |||
| 129 | var expected = new[] | ||
| 130 | { | ||
| 131 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\" xmlns:bal=\"http://wixtoolset.org/schemas/v4/wxs/bal\">", | ||
| 132 | " <Fragment>", | ||
| 133 | " <BootstrapperApplication>", | ||
| 134 | " <bal:WixManagedBootstrapperApplicationHost LogoFile=\"logo.png\" />", | ||
| 135 | " </BootstrapperApplication>", | ||
| 136 | " </Fragment>", | ||
| 137 | "</Wix>" | ||
| 138 | }; | ||
| 139 | |||
| 140 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | ||
| 141 | |||
| 142 | var messaging = new MockMessaging(); | ||
| 143 | var converter = new WixConverter(messaging, 2, null, null); | ||
| 144 | |||
| 145 | var errors = converter.ConvertDocument(document); | ||
| 146 | Assert.Equal(3, errors); | ||
| 147 | |||
| 148 | var actualLines = UnformattedDocumentLines(document); | ||
| 149 | WixAssert.CompareLineByLine(expected, actualLines); | ||
| 150 | } | ||
| 151 | |||
| 152 | [Fact] | ||
| 153 | public void ConvertFrameworkBootstrapperApplicationRefWithoutExistingElement() | ||
| 154 | { | ||
| 155 | var parse = String.Join(Environment.NewLine, | ||
| 156 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi' xmlns:bal='http://schemas.microsoft.com/wix/BalExtension'>", | ||
| 157 | " <Fragment>", | ||
| 158 | " <BootstrapperApplicationRef Id='ManagedBootstrapperApplicationHost.RtfLicense.Minimal' />", | ||
| 159 | " </Fragment>", | ||
| 160 | "</Wix>"); | ||
| 161 | |||
| 162 | var expected = new[] | ||
| 163 | { | ||
| 164 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\" xmlns:bal=\"http://wixtoolset.org/schemas/v4/wxs/bal\">", | ||
| 165 | " <Fragment>", | ||
| 166 | " <BootstrapperApplication>", | ||
| 167 | "<bal:WixManagedBootstrapperApplicationHost Theme=\"none\" />", | ||
| 168 | "</BootstrapperApplication>", | ||
| 169 | " </Fragment>", | ||
| 170 | "</Wix>" | ||
| 171 | }; | ||
| 172 | |||
| 173 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | ||
| 174 | |||
| 175 | var messaging = new MockMessaging(); | ||
| 176 | var converter = new WixConverter(messaging, 2, null, null); | ||
| 177 | |||
| 178 | var errors = converter.ConvertDocument(document); | ||
| 179 | Assert.Equal(3, errors); | ||
| 180 | |||
| 181 | var actualLines = UnformattedDocumentLines(document); | ||
| 182 | WixAssert.CompareLineByLine(expected, actualLines); | ||
| 183 | } | ||
| 184 | |||
| 185 | [Fact] | ||
| 186 | public void ConvertStandardBootstrapperApplicationRefWithExistingElement() | ||
| 187 | { | ||
| 188 | var parse = String.Join(Environment.NewLine, | ||
| 189 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi' xmlns:bal='http://schemas.microsoft.com/wix/BalExtension'>", | ||
| 190 | " <Fragment>", | ||
| 191 | " <BootstrapperApplicationRef Id='WixStandardBootstrapperApplication.Foundation'>", | ||
| 192 | " <bal:WixStandardBootstrapperApplication LaunchTarget='[InstallFolder]the.exe' />", | ||
| 193 | " </BootstrapperApplicationRef>", | ||
| 194 | " </Fragment>", | ||
| 195 | "</Wix>"); | ||
| 196 | |||
| 197 | var expected = new[] | ||
| 198 | { | ||
| 199 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\" xmlns:bal=\"http://wixtoolset.org/schemas/v4/wxs/bal\">", | ||
| 200 | " <Fragment>", | ||
| 201 | " <BootstrapperApplication>", | ||
| 202 | " <bal:WixStandardBootstrapperApplication LaunchTarget=\"[InstallFolder]the.exe\" Theme=\"none\" />", | ||
| 203 | " </BootstrapperApplication>", | ||
| 204 | " </Fragment>", | ||
| 205 | "</Wix>" | ||
| 206 | }; | ||
| 207 | |||
| 208 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | ||
| 209 | |||
| 210 | var messaging = new MockMessaging(); | ||
| 211 | var converter = new WixConverter(messaging, 2, null, null); | ||
| 212 | |||
| 213 | var errors = converter.ConvertDocument(document); | ||
| 214 | Assert.Equal(3, errors); | ||
| 215 | |||
| 216 | var actualLines = UnformattedDocumentLines(document); | ||
| 217 | WixAssert.CompareLineByLine(expected, actualLines); | ||
| 218 | } | ||
| 219 | |||
| 220 | [Fact] | ||
| 221 | public void ConvertStandardBootstrapperApplicationRefWithoutExistingElement() | ||
| 222 | { | ||
| 223 | var parse = String.Join(Environment.NewLine, | ||
| 224 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi' xmlns:bal='http://schemas.microsoft.com/wix/BalExtension'>", | ||
| 225 | " <Fragment>", | ||
| 226 | " <BootstrapperApplicationRef Id='WixStandardBootstrapperApplication.RtfLicense' />", | ||
| 227 | " </Fragment>", | ||
| 228 | "</Wix>"); | ||
| 229 | |||
| 230 | var expected = new[] | ||
| 231 | { | ||
| 232 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\" xmlns:bal=\"http://wixtoolset.org/schemas/v4/wxs/bal\">", | ||
| 233 | " <Fragment>", | ||
| 234 | " <BootstrapperApplication>", | ||
| 235 | "<bal:WixStandardBootstrapperApplication Theme=\"rtfLicense\" />", | ||
| 236 | "</BootstrapperApplication>", | ||
| 237 | " </Fragment>", | ||
| 238 | "</Wix>" | ||
| 239 | }; | ||
| 240 | |||
| 241 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | ||
| 242 | |||
| 243 | var messaging = new MockMessaging(); | ||
| 244 | var converter = new WixConverter(messaging, 2, null, null); | ||
| 245 | |||
| 246 | var errors = converter.ConvertDocument(document); | ||
| 247 | Assert.Equal(3, errors); | ||
| 248 | |||
| 249 | var actualLines = UnformattedDocumentLines(document); | ||
| 250 | WixAssert.CompareLineByLine(expected, actualLines); | ||
| 251 | } | ||
| 252 | |||
| 253 | [Fact] | ||
| 50 | public void CreateBootstrapperApplicationDllFromV3() | 254 | public void CreateBootstrapperApplicationDllFromV3() |
| 51 | { | 255 | { |
| 52 | var parse = String.Join(Environment.NewLine, | 256 | var parse = String.Join(Environment.NewLine, |
