diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2020-07-19 19:08:40 +1000 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2020-07-19 19:22:41 +1000 |
| commit | ecad1128c6223920a035cd12502e316452e61c93 (patch) | |
| tree | 3ae6a1120ec443d3e67dbf38a448e93628cd507e /src/test | |
| parent | 901e856ef5c72be5fc7cfb3077e2e60892ddd4cc (diff) | |
| download | wix-ecad1128c6223920a035cd12502e316452e61c93.tar.gz wix-ecad1128c6223920a035cd12502e316452e61c93.tar.bz2 wix-ecad1128c6223920a035cd12502e316452e61c93.zip | |
Set DpiAwareness to "unaware" from v3.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/WixToolsetTest.Converters/BootstrapperApplicationFixture.cs | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.Converters/BootstrapperApplicationFixture.cs b/src/test/WixToolsetTest.Converters/BootstrapperApplicationFixture.cs new file mode 100644 index 00000000..1551077b --- /dev/null +++ b/src/test/WixToolsetTest.Converters/BootstrapperApplicationFixture.cs | |||
| @@ -0,0 +1,76 @@ | |||
| 1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
| 2 | |||
| 3 | namespace WixToolsetTest.Converters | ||
| 4 | { | ||
| 5 | using System; | ||
| 6 | using System.Xml.Linq; | ||
| 7 | using WixBuildTools.TestSupport; | ||
| 8 | using WixToolset.Converters; | ||
| 9 | using WixToolsetTest.Converters.Mocks; | ||
| 10 | using Xunit; | ||
| 11 | |||
| 12 | public class BootstrapperApplicationFixture : BaseConverterFixture | ||
| 13 | { | ||
| 14 | [Fact] | ||
| 15 | public void SetsDpiUnawareFromV3() | ||
| 16 | { | ||
| 17 | var parse = String.Join(Environment.NewLine, | ||
| 18 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>", | ||
| 19 | " <Fragment>", | ||
| 20 | " <BootstrapperApplication Id='ba' />", | ||
| 21 | " </Fragment>", | ||
| 22 | "</Wix>"); | ||
| 23 | |||
| 24 | var expected = new[] | ||
| 25 | { | ||
| 26 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | ||
| 27 | " <Fragment>", | ||
| 28 | " <BootstrapperApplication Id=\"ba\" DpiAwareness=\"unaware\" />", | ||
| 29 | " </Fragment>", | ||
| 30 | "</Wix>" | ||
| 31 | }; | ||
| 32 | |||
| 33 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | ||
| 34 | |||
| 35 | var messaging = new MockMessaging(); | ||
| 36 | var converter = new WixConverter(messaging, 2, null, null); | ||
| 37 | |||
| 38 | var errors = converter.ConvertDocument(document); | ||
| 39 | Assert.Equal(2, errors); | ||
| 40 | |||
| 41 | var actualLines = UnformattedDocumentLines(document); | ||
| 42 | CompareLineByLine(expected, actualLines); | ||
| 43 | } | ||
| 44 | |||
| 45 | [Fact] | ||
| 46 | public void DoesntSetDpiUnawareFromV4() | ||
| 47 | { | ||
| 48 | var parse = String.Join(Environment.NewLine, | ||
| 49 | "<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>", | ||
| 50 | " <Fragment>", | ||
| 51 | " <BootstrapperApplication Id='ba' />", | ||
| 52 | " </Fragment>", | ||
| 53 | "</Wix>"); | ||
| 54 | |||
| 55 | var expected = new[] | ||
| 56 | { | ||
| 57 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | ||
| 58 | " <Fragment>", | ||
| 59 | " <BootstrapperApplication Id=\"ba\" />", | ||
| 60 | " </Fragment>", | ||
| 61 | "</Wix>" | ||
| 62 | }; | ||
| 63 | |||
| 64 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | ||
| 65 | |||
| 66 | var messaging = new MockMessaging(); | ||
| 67 | var converter = new WixConverter(messaging, 2, null, null); | ||
| 68 | |||
| 69 | var errors = converter.ConvertDocument(document); | ||
| 70 | Assert.Equal(0, errors); | ||
| 71 | |||
| 72 | var actualLines = UnformattedDocumentLines(document); | ||
| 73 | CompareLineByLine(expected, actualLines); | ||
| 74 | } | ||
| 75 | } | ||
| 76 | } | ||
