diff options
| author | Rob Mensching <rob@firegiant.com> | 2021-03-23 16:26:20 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2021-03-23 16:41:40 -0700 |
| commit | 7dff57257c06da8c861a1a54e32f97fd9f22357c (patch) | |
| tree | 01c4056497911be5f26e3cfb090e9c5ea036a532 /src/test | |
| parent | 7e44ed28026cad6f624a836a5faf9d9b6174d6f3 (diff) | |
| download | wix-7dff57257c06da8c861a1a54e32f97fd9f22357c.tar.gz wix-7dff57257c06da8c861a1a54e32f97fd9f22357c.tar.bz2 wix-7dff57257c06da8c861a1a54e32f97fd9f22357c.zip | |
Fixup SoftwareTag deprecations and SoftwareTagRef conversion
Fixes wixtoolset/issues#6379
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/WixToolsetTest.Converters/TagFixture.cs | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.Converters/TagFixture.cs b/src/test/WixToolsetTest.Converters/TagFixture.cs index c163ea11..5e07c83b 100644 --- a/src/test/WixToolsetTest.Converters/TagFixture.cs +++ b/src/test/WixToolsetTest.Converters/TagFixture.cs | |||
| @@ -41,5 +41,71 @@ namespace WixToolsetTest.Converters | |||
| 41 | var actualLines = UnformattedDocumentLines(document); | 41 | var actualLines = UnformattedDocumentLines(document); |
| 42 | WixAssert.CompareLineByLine(expected, actualLines); | 42 | WixAssert.CompareLineByLine(expected, actualLines); |
| 43 | } | 43 | } |
| 44 | |||
| 45 | [Fact] | ||
| 46 | public void FixTagExtensionDeprecations() | ||
| 47 | { | ||
| 48 | var parse = String.Join(Environment.NewLine, | ||
| 49 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi' xmlns:tag='http://schemas.microsoft.com/wix/TagExtension'>", | ||
| 50 | " <Product>", | ||
| 51 | " <tag:Tag Regid='wixtoolset.org' InstallDirectory='InstallFolder' Licensed='true' Type='component' Win64='yes' />", | ||
| 52 | " </Product>", | ||
| 53 | "</Wix>"); | ||
| 54 | |||
| 55 | var expected = new[] | ||
| 56 | { | ||
| 57 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | ||
| 58 | " <Package>", | ||
| 59 | " <SoftwareTag Regid=\"wixtoolset.org\" InstallDirectory=\"InstallFolder\" Bitness=\"always64\" />", | ||
| 60 | " </Package>", | ||
| 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(7, errors); | ||
| 71 | |||
| 72 | var actualLines = UnformattedDocumentLines(document); | ||
| 73 | WixAssert.CompareLineByLine(expected, actualLines); | ||
| 74 | } | ||
| 75 | |||
| 76 | [Fact] | ||
| 77 | public void FixTagExtensionTagRef() | ||
| 78 | { | ||
| 79 | var parse = String.Join(Environment.NewLine, | ||
| 80 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi' xmlns:tag='http://schemas.microsoft.com/wix/TagExtension'>", | ||
| 81 | " <Fragment>", | ||
| 82 | " <PatchFamily>", | ||
| 83 | " <tag:TagRef Regid='wixtoolset.org' />", | ||
| 84 | " </PatchFamily>", | ||
| 85 | " </Fragment>", | ||
| 86 | "</Wix>"); | ||
| 87 | |||
| 88 | var expected = new[] | ||
| 89 | { | ||
| 90 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | ||
| 91 | " <Fragment>", | ||
| 92 | " <PatchFamily>", | ||
| 93 | " <SoftwareTagRef Regid=\"wixtoolset.org\" />", | ||
| 94 | " </PatchFamily>", | ||
| 95 | " </Fragment>", | ||
| 96 | "</Wix>" | ||
| 97 | }; | ||
| 98 | |||
| 99 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | ||
| 100 | |||
| 101 | var messaging = new MockMessaging(); | ||
| 102 | var converter = new WixConverter(messaging, 2, null, null); | ||
| 103 | |||
| 104 | var errors = converter.ConvertDocument(document); | ||
| 105 | Assert.Equal(3, errors); | ||
| 106 | |||
| 107 | var actualLines = UnformattedDocumentLines(document); | ||
| 108 | WixAssert.CompareLineByLine(expected, actualLines); | ||
| 109 | } | ||
| 44 | } | 110 | } |
| 45 | } | 111 | } |
