diff options
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 | } | ||