diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2020-12-08 15:14:40 -0600 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2020-12-08 15:23:39 -0600 |
| commit | 05cafee83e597badaf842bd7e6ba06f4d8fe193f (patch) | |
| tree | 5d01b6b0497a05e8b6b748f862bfcfa8f9658440 /src/test | |
| parent | d4a7583d9df4a3ac14f8c000802fb500b9948a29 (diff) | |
| download | wix-05cafee83e597badaf842bd7e6ba06f4d8fe193f.tar.gz wix-05cafee83e597badaf842bd7e6ba06f4d8fe193f.tar.bz2 wix-05cafee83e597badaf842bd7e6ba06f4d8fe193f.zip | |
Add conversion for BootstrapperApplicationDll and bal:UseUILanguages.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/WixToolsetTest.Converters/BootstrapperApplicationFixture.cs | 144 |
1 files changed, 141 insertions, 3 deletions
diff --git a/src/test/WixToolsetTest.Converters/BootstrapperApplicationFixture.cs b/src/test/WixToolsetTest.Converters/BootstrapperApplicationFixture.cs index 68a8afc8..dc5bae00 100644 --- a/src/test/WixToolsetTest.Converters/BootstrapperApplicationFixture.cs +++ b/src/test/WixToolsetTest.Converters/BootstrapperApplicationFixture.cs | |||
| @@ -12,12 +12,14 @@ namespace WixToolsetTest.Converters | |||
| 12 | public class BootstrapperApplicationFixture : BaseConverterFixture | 12 | public class BootstrapperApplicationFixture : BaseConverterFixture |
| 13 | { | 13 | { |
| 14 | [Fact] | 14 | [Fact] |
| 15 | public void SetsDpiUnawareFromV3() | 15 | public void CantCreateBootstrapperApplicationDllFromV3PayloadGroupRef() |
| 16 | { | 16 | { |
| 17 | var parse = String.Join(Environment.NewLine, | 17 | var parse = String.Join(Environment.NewLine, |
| 18 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>", | 18 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>", |
| 19 | " <Fragment>", | 19 | " <Fragment>", |
| 20 | " <BootstrapperApplication Id='ba' />", | 20 | " <BootstrapperApplication Id='ba'>", |
| 21 | " <PayloadGroupRef Id='baPayloads' />", | ||
| 22 | " </BootstrapperApplication>", | ||
| 21 | " </Fragment>", | 23 | " </Fragment>", |
| 22 | "</Wix>"); | 24 | "</Wix>"); |
| 23 | 25 | ||
| @@ -25,7 +27,9 @@ namespace WixToolsetTest.Converters | |||
| 25 | { | 27 | { |
| 26 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | 28 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", |
| 27 | " <Fragment>", | 29 | " <Fragment>", |
| 28 | " <BootstrapperApplication Id=\"ba\" DpiAwareness=\"unaware\" />", | 30 | " <BootstrapperApplication Id=\"ba\">", |
| 31 | " <PayloadGroupRef Id=\"baPayloads\" />", | ||
| 32 | " </BootstrapperApplication>", | ||
| 29 | " </Fragment>", | 33 | " </Fragment>", |
| 30 | "</Wix>" | 34 | "</Wix>" |
| 31 | }; | 35 | }; |
| @@ -43,6 +47,76 @@ namespace WixToolsetTest.Converters | |||
| 43 | } | 47 | } |
| 44 | 48 | ||
| 45 | [Fact] | 49 | [Fact] |
| 50 | public void CreateBootstrapperApplicationDllFromV3() | ||
| 51 | { | ||
| 52 | var parse = String.Join(Environment.NewLine, | ||
| 53 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>", | ||
| 54 | " <Fragment>", | ||
| 55 | " <BootstrapperApplication Id='ba' SourceFile='ba.dll' />", | ||
| 56 | " </Fragment>", | ||
| 57 | "</Wix>"); | ||
| 58 | |||
| 59 | var expected = new[] | ||
| 60 | { | ||
| 61 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | ||
| 62 | " <Fragment>", | ||
| 63 | " <BootstrapperApplication Id=\"ba\">", | ||
| 64 | "<BootstrapperApplicationDll SourceFile=\"ba.dll\" DpiAwareness=\"unaware\" />", | ||
| 65 | "</BootstrapperApplication>", | ||
| 66 | " </Fragment>", | ||
| 67 | "</Wix>" | ||
| 68 | }; | ||
| 69 | |||
| 70 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | ||
| 71 | |||
| 72 | var messaging = new MockMessaging(); | ||
| 73 | var converter = new WixConverter(messaging, 2, null, null); | ||
| 74 | |||
| 75 | var errors = converter.ConvertDocument(document); | ||
| 76 | Assert.Equal(3, errors); | ||
| 77 | |||
| 78 | var actualLines = UnformattedDocumentLines(document); | ||
| 79 | WixAssert.CompareLineByLine(expected, actualLines); | ||
| 80 | } | ||
| 81 | |||
| 82 | [Fact] | ||
| 83 | public void CreateBootstrapperApplicationDllFromV3Payload() | ||
| 84 | { | ||
| 85 | var parse = String.Join(Environment.NewLine, | ||
| 86 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>", | ||
| 87 | " <Fragment>", | ||
| 88 | " <BootstrapperApplication Id='ba'>", | ||
| 89 | " <Payload SourceFile='ba.dll' />", | ||
| 90 | " </BootstrapperApplication>", | ||
| 91 | " </Fragment>", | ||
| 92 | "</Wix>"); | ||
| 93 | |||
| 94 | var expected = new[] | ||
| 95 | { | ||
| 96 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | ||
| 97 | " <Fragment>", | ||
| 98 | " <BootstrapperApplication Id=\"ba\">", | ||
| 99 | " ", | ||
| 100 | " ", | ||
| 101 | "<BootstrapperApplicationDll SourceFile=\"ba.dll\" DpiAwareness=\"unaware\" />", | ||
| 102 | "</BootstrapperApplication>", | ||
| 103 | " </Fragment>", | ||
| 104 | "</Wix>" | ||
| 105 | }; | ||
| 106 | |||
| 107 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | ||
| 108 | |||
| 109 | var messaging = new MockMessaging(); | ||
| 110 | var converter = new WixConverter(messaging, 2, null, null); | ||
| 111 | |||
| 112 | var errors = converter.ConvertDocument(document); | ||
| 113 | Assert.Equal(3, errors); | ||
| 114 | |||
| 115 | var actualLines = UnformattedDocumentLines(document); | ||
| 116 | WixAssert.CompareLineByLine(expected, actualLines); | ||
| 117 | } | ||
| 118 | |||
| 119 | [Fact] | ||
| 46 | public void DoesntSetDpiUnawareFromV4() | 120 | public void DoesntSetDpiUnawareFromV4() |
| 47 | { | 121 | { |
| 48 | var parse = String.Join(Environment.NewLine, | 122 | var parse = String.Join(Environment.NewLine, |
| @@ -72,5 +146,69 @@ namespace WixToolsetTest.Converters | |||
| 72 | var actualLines = UnformattedDocumentLines(document); | 146 | var actualLines = UnformattedDocumentLines(document); |
| 73 | WixAssert.CompareLineByLine(expected, actualLines); | 147 | WixAssert.CompareLineByLine(expected, actualLines); |
| 74 | } | 148 | } |
| 149 | |||
| 150 | [Fact] | ||
| 151 | public void KeepsDpiAwarenessFromV4() | ||
| 152 | { | ||
| 153 | var parse = String.Join(Environment.NewLine, | ||
| 154 | "<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>", | ||
| 155 | " <Fragment>", | ||
| 156 | " <BootstrapperApplication Id='ba' SourceFile='ba.dll' DpiAwareness='system' />", | ||
| 157 | " </Fragment>", | ||
| 158 | "</Wix>"); | ||
| 159 | |||
| 160 | var expected = new[] | ||
| 161 | { | ||
| 162 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | ||
| 163 | " <Fragment>", | ||
| 164 | " <BootstrapperApplication Id=\"ba\">", | ||
| 165 | "<BootstrapperApplicationDll SourceFile=\"ba.dll\" DpiAwareness=\"system\" />", | ||
| 166 | "</BootstrapperApplication>", | ||
| 167 | " </Fragment>", | ||
| 168 | "</Wix>" | ||
| 169 | }; | ||
| 170 | |||
| 171 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | ||
| 172 | |||
| 173 | var messaging = new MockMessaging(); | ||
| 174 | var converter = new WixConverter(messaging, 2, null, null); | ||
| 175 | |||
| 176 | var errors = converter.ConvertDocument(document); | ||
| 177 | Assert.Equal(1, errors); | ||
| 178 | |||
| 179 | var actualLines = UnformattedDocumentLines(document); | ||
| 180 | WixAssert.CompareLineByLine(expected, actualLines); | ||
| 181 | } | ||
| 182 | |||
| 183 | [Fact] | ||
| 184 | public void RemovesBalUseUILanguages() | ||
| 185 | { | ||
| 186 | var parse = String.Join(Environment.NewLine, | ||
| 187 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi' xmlns:bal='http://schemas.microsoft.com/wix/BalExtension'>", | ||
| 188 | " <Fragment>", | ||
| 189 | " <BootstrapperApplication Id='ba' bal:UseUILanguages='true' />", | ||
| 190 | " </Fragment>", | ||
| 191 | "</Wix>"); | ||
| 192 | |||
| 193 | var expected = new[] | ||
| 194 | { | ||
| 195 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\" xmlns:bal=\"http://wixtoolset.org/schemas/v4/wxs/bal\">", | ||
| 196 | " <Fragment>", | ||
| 197 | " <BootstrapperApplication Id=\"ba\" />", | ||
| 198 | " </Fragment>", | ||
| 199 | "</Wix>" | ||
| 200 | }; | ||
| 201 | |||
| 202 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | ||
| 203 | |||
| 204 | var messaging = new MockMessaging(); | ||
| 205 | var converter = new WixConverter(messaging, 2, null, null); | ||
| 206 | |||
| 207 | var errors = converter.ConvertDocument(document); | ||
| 208 | Assert.Equal(4, errors); | ||
| 209 | |||
| 210 | var actualLines = UnformattedDocumentLines(document); | ||
| 211 | WixAssert.CompareLineByLine(expected, actualLines); | ||
| 212 | } | ||
| 75 | } | 213 | } |
| 76 | } | 214 | } |
