diff options
| author | Rob Mensching <rob@firegiant.com> | 2020-06-12 06:54:42 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2020-06-12 08:26:18 -0700 |
| commit | 90bdfa6e06862030f6b255a4dcacb5871a35b1a1 (patch) | |
| tree | 9928b6dc72b9fdd6463debd1e4ccb360c66bb63e /src/test | |
| parent | b123126f6c3511259e4520cc7151e9dce9c534bc (diff) | |
| download | wix-90bdfa6e06862030f6b255a4dcacb5871a35b1a1.tar.gz wix-90bdfa6e06862030f6b255a4dcacb5871a35b1a1.tar.bz2 wix-90bdfa6e06862030f6b255a4dcacb5871a35b1a1.zip | |
Convert custom table Column Category and Modularize attributes
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/WixToolsetTest.Converters/CustomTableFixture.cs | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.Converters/CustomTableFixture.cs b/src/test/WixToolsetTest.Converters/CustomTableFixture.cs new file mode 100644 index 00000000..5a572294 --- /dev/null +++ b/src/test/WixToolsetTest.Converters/CustomTableFixture.cs | |||
| @@ -0,0 +1,50 @@ | |||
| 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 WixToolset.Converters; | ||
| 8 | using WixToolsetTest.Converters.Mocks; | ||
| 9 | using Xunit; | ||
| 10 | |||
| 11 | public class CustomTableFixture : BaseConverterFixture | ||
| 12 | { | ||
| 13 | [Fact] | ||
| 14 | public void FixCustomTableCategoryAndModularization() | ||
| 15 | { | ||
| 16 | var parse = String.Join(Environment.NewLine, | ||
| 17 | "<?xml version=\"1.0\" encoding=\"utf-16\"?>", | ||
| 18 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>", | ||
| 19 | " <Fragment>", | ||
| 20 | " <CustomTable Id='Custom1'>", | ||
| 21 | " <Column Id='Column1' Type='string' Category='Text' Modularize='Column' />", | ||
| 22 | " </CustomTable>", | ||
| 23 | " </Fragment>", | ||
| 24 | "</Wix>"); | ||
| 25 | |||
| 26 | var expected = new[] | ||
| 27 | { | ||
| 28 | "<?xml version=\"1.0\" encoding=\"utf-16\"?>", | ||
| 29 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | ||
| 30 | " <Fragment>", | ||
| 31 | " <CustomTable Id=\"Custom1\">", | ||
| 32 | " <Column Id=\"Column1\" Type=\"string\" Category=\"text\" Modularize=\"column\" />", | ||
| 33 | " </CustomTable>", | ||
| 34 | " </Fragment>", | ||
| 35 | "</Wix>" | ||
| 36 | }; | ||
| 37 | |||
| 38 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | ||
| 39 | |||
| 40 | var messaging = new MockMessaging(); | ||
| 41 | var converter = new Wix3Converter(messaging, 2, null, null); | ||
| 42 | |||
| 43 | var errors = converter.ConvertDocument(document); | ||
| 44 | Assert.Equal(4, errors); | ||
| 45 | |||
| 46 | var actualLines = UnformattedDocumentLines(document); | ||
| 47 | CompareLineByLine(expected, actualLines); | ||
| 48 | } | ||
| 49 | } | ||
| 50 | } | ||
