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