diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2020-11-01 17:45:42 -0600 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2020-11-01 18:38:20 -0600 |
| commit | 06b0b7b3e5504d062fc2226dd9a64dc4efa41f47 (patch) | |
| tree | c46eb0f6a4b3a9e1e0eb5eb7d9217d769871b55a /src/test | |
| parent | f48db8f05c4fa2ad8a67190db8c43cb2b364bd99 (diff) | |
| download | wix-06b0b7b3e5504d062fc2226dd9a64dc4efa41f47.tar.gz wix-06b0b7b3e5504d062fc2226dd9a64dc4efa41f47.tar.bz2 wix-06b0b7b3e5504d062fc2226dd9a64dc4efa41f47.zip | |
Add warnings for util:RegistrySearch (value) and DisplayInternalUI.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/WixToolsetTest.Converters/FirewallExtensionFixture.cs (renamed from src/test/WixToolsetTest.Converters/ExtensionFixture.cs) | 33 | ||||
| -rw-r--r-- | src/test/WixToolsetTest.Converters/UtilExtensionFixture.cs | 35 |
2 files changed, 35 insertions, 33 deletions
diff --git a/src/test/WixToolsetTest.Converters/ExtensionFixture.cs b/src/test/WixToolsetTest.Converters/FirewallExtensionFixture.cs index 4bf2ed3d..f3437078 100644 --- a/src/test/WixToolsetTest.Converters/ExtensionFixture.cs +++ b/src/test/WixToolsetTest.Converters/FirewallExtensionFixture.cs | |||
| @@ -43,38 +43,5 @@ namespace WixToolsetTest.Converters | |||
| 43 | var actualLines = UnformattedDocumentLines(document); | 43 | var actualLines = UnformattedDocumentLines(document); |
| 44 | WixAssert.CompareLineByLine(expected, actualLines); | 44 | WixAssert.CompareLineByLine(expected, actualLines); |
| 45 | } | 45 | } |
| 46 | |||
| 47 | [Fact] | ||
| 48 | public void FixXmlConfigValue() | ||
| 49 | { | ||
| 50 | var parse = String.Join(Environment.NewLine, | ||
| 51 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi' xmlns:util='http://schemas.microsoft.com/wix/UtilExtension'>", | ||
| 52 | " <Fragment>", | ||
| 53 | " <util:XmlConfig Id='Change' ElementPath='book'>", | ||
| 54 | " a<>b", | ||
| 55 | " </util:XmlConfig>", | ||
| 56 | " </Fragment>", | ||
| 57 | "</Wix>"); | ||
| 58 | |||
| 59 | var expected = new[] | ||
| 60 | { | ||
| 61 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\" xmlns:util=\"http://wixtoolset.org/schemas/v4/wxs/util\">", | ||
| 62 | " <Fragment>", | ||
| 63 | " <util:XmlConfig Id=\"Change\" ElementPath=\"book\" Value=\"a<>b\" />", | ||
| 64 | " </Fragment>", | ||
| 65 | "</Wix>" | ||
| 66 | }; | ||
| 67 | |||
| 68 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | ||
| 69 | |||
| 70 | var messaging = new MockMessaging(); | ||
| 71 | var converter = new WixConverter(messaging, 2, null, null); | ||
| 72 | |||
| 73 | var errors = converter.ConvertDocument(document); | ||
| 74 | Assert.Equal(3, errors); | ||
| 75 | |||
| 76 | var actualLines = UnformattedDocumentLines(document); | ||
| 77 | WixAssert.CompareLineByLine(expected, actualLines); | ||
| 78 | } | ||
| 79 | } | 46 | } |
| 80 | } | 47 | } |
diff --git a/src/test/WixToolsetTest.Converters/UtilExtensionFixture.cs b/src/test/WixToolsetTest.Converters/UtilExtensionFixture.cs index 9d55af79..9964e3b0 100644 --- a/src/test/WixToolsetTest.Converters/UtilExtensionFixture.cs +++ b/src/test/WixToolsetTest.Converters/UtilExtensionFixture.cs | |||
| @@ -76,5 +76,40 @@ namespace WixToolsetTest.Converters | |||
| 76 | var actualLines = UnformattedDocumentLines(document); | 76 | var actualLines = UnformattedDocumentLines(document); |
| 77 | WixAssert.CompareLineByLine(expected, actualLines); | 77 | WixAssert.CompareLineByLine(expected, actualLines); |
| 78 | } | 78 | } |
| 79 | |||
| 80 | [Fact] | ||
| 81 | public void WarnsOnAllRegistryValueSearches() | ||
| 82 | { | ||
| 83 | var parse = String.Join(Environment.NewLine, | ||
| 84 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi' xmlns:util='http://schemas.microsoft.com/wix/UtilExtension'>", | ||
| 85 | " <Fragment>", | ||
| 86 | " <util:RegistrySearch Id='RegValue' Root='HKLM' Key='Converter' Variable='Test' />", | ||
| 87 | " <util:RegistrySearch Id='RegValue2' Root='HKLM' Key='Converter' Variable='Test' Result='value' />", | ||
| 88 | " <util:RegistrySearch Id='RegValue3' Root='HKLM' Key='Converter' Variable='Test' Result='exists' />", | ||
| 89 | " </Fragment>", | ||
| 90 | "</Wix>"); | ||
| 91 | |||
| 92 | var expected = new[] | ||
| 93 | { | ||
| 94 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\" xmlns:util=\"http://wixtoolset.org/schemas/v4/wxs/util\">", | ||
| 95 | " <Fragment>", | ||
| 96 | " <util:RegistrySearch Id=\"RegValue\" Root=\"HKLM\" Key=\"Converter\" Variable=\"Test\" />", | ||
| 97 | " <util:RegistrySearch Id=\"RegValue2\" Root=\"HKLM\" Key=\"Converter\" Variable=\"Test\" Result=\"value\" />", | ||
| 98 | " <util:RegistrySearch Id=\"RegValue3\" Root=\"HKLM\" Key=\"Converter\" Variable=\"Test\" Result=\"exists\" />", | ||
| 99 | " </Fragment>", | ||
| 100 | "</Wix>" | ||
| 101 | }; | ||
| 102 | |||
| 103 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | ||
| 104 | |||
| 105 | var messaging = new MockMessaging(); | ||
| 106 | var converter = new WixConverter(messaging, 2, null, null); | ||
| 107 | |||
| 108 | var errors = converter.ConvertDocument(document); | ||
| 109 | Assert.Equal(4, errors); | ||
| 110 | |||
| 111 | var actualLines = UnformattedDocumentLines(document); | ||
| 112 | WixAssert.CompareLineByLine(expected, actualLines); | ||
| 113 | } | ||
| 79 | } | 114 | } |
| 80 | } | 115 | } |
