diff options
| author | Rob Mensching <rob@firegiant.com> | 2020-06-23 00:58:11 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2020-06-23 16:56:04 -0700 |
| commit | 7987d2f7e2d47427d7571ab7cc3640d7b0bbb7ff (patch) | |
| tree | 97e5a295cc5ccfaa0ad47d692c3103d7d49b5962 /src/test/WixToolsetTest.Converters/CustomTableFixture.cs | |
| parent | 99cdb4f1d7829a2efb503881abe57033672c2b47 (diff) | |
| download | wix-7987d2f7e2d47427d7571ab7cc3640d7b0bbb7ff.tar.gz wix-7987d2f7e2d47427d7571ab7cc3640d7b0bbb7ff.tar.bz2 wix-7987d2f7e2d47427d7571ab7cc3640d7b0bbb7ff.zip | |
Convert inner text to appropriate attributes
Diffstat (limited to 'src/test/WixToolsetTest.Converters/CustomTableFixture.cs')
| -rw-r--r-- | src/test/WixToolsetTest.Converters/CustomTableFixture.cs | 145 |
1 files changed, 145 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.Converters/CustomTableFixture.cs b/src/test/WixToolsetTest.Converters/CustomTableFixture.cs index 5a572294..c09534ee 100644 --- a/src/test/WixToolsetTest.Converters/CustomTableFixture.cs +++ b/src/test/WixToolsetTest.Converters/CustomTableFixture.cs | |||
| @@ -46,5 +46,150 @@ namespace WixToolsetTest.Converters | |||
| 46 | var actualLines = UnformattedDocumentLines(document); | 46 | var actualLines = UnformattedDocumentLines(document); |
| 47 | CompareLineByLine(expected, actualLines); | 47 | CompareLineByLine(expected, actualLines); |
| 48 | } | 48 | } |
| 49 | |||
| 50 | [Fact] | ||
| 51 | public void FixCustomRowTextValue() | ||
| 52 | { | ||
| 53 | var parse = String.Join(Environment.NewLine, | ||
| 54 | "<?xml version=\"1.0\" encoding=\"utf-16\"?>", | ||
| 55 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>", | ||
| 56 | " <Fragment>", | ||
| 57 | " <CustomTable Id='Custom1'>", | ||
| 58 | " <Row Id='Column1'>", | ||
| 59 | " Some value", | ||
| 60 | " </Row>", | ||
| 61 | " </CustomTable>", | ||
| 62 | " </Fragment>", | ||
| 63 | "</Wix>"); | ||
| 64 | |||
| 65 | var expected = new[] | ||
| 66 | { | ||
| 67 | "<?xml version=\"1.0\" encoding=\"utf-16\"?>", | ||
| 68 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | ||
| 69 | " <Fragment>", | ||
| 70 | " <CustomTable Id=\"Custom1\">", | ||
| 71 | " <Row Id=\"Column1\" Value=\"Some value\" />", | ||
| 72 | " </CustomTable>", | ||
| 73 | " </Fragment>", | ||
| 74 | "</Wix>" | ||
| 75 | }; | ||
| 76 | |||
| 77 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | ||
| 78 | |||
| 79 | var messaging = new MockMessaging(); | ||
| 80 | var converter = new Wix3Converter(messaging, 2, null, null); | ||
| 81 | |||
| 82 | var errors = converter.ConvertDocument(document); | ||
| 83 | Assert.Equal(3, errors); | ||
| 84 | |||
| 85 | var actualLines = UnformattedDocumentLines(document); | ||
| 86 | CompareLineByLine(expected, actualLines); | ||
| 87 | } | ||
| 88 | |||
| 89 | [Fact] | ||
| 90 | public void FixCustomRowCdataValue() | ||
| 91 | { | ||
| 92 | var parse = String.Join(Environment.NewLine, | ||
| 93 | "<?xml version=\"1.0\" encoding=\"utf-16\"?>", | ||
| 94 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>", | ||
| 95 | " <Fragment>", | ||
| 96 | " <CustomTable Id='Custom1'>", | ||
| 97 | " <Row Id='Column1'>", | ||
| 98 | " <![CDATA[", | ||
| 99 | " Some value", | ||
| 100 | " ]]>", | ||
| 101 | " </Row>", | ||
| 102 | " </CustomTable>", | ||
| 103 | " </Fragment>", | ||
| 104 | "</Wix>"); | ||
| 105 | |||
| 106 | var expected = new[] | ||
| 107 | { | ||
| 108 | "<?xml version=\"1.0\" encoding=\"utf-16\"?>", | ||
| 109 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | ||
| 110 | " <Fragment>", | ||
| 111 | " <CustomTable Id=\"Custom1\">", | ||
| 112 | " <Row Id=\"Column1\" Value=\"Some value\" />", | ||
| 113 | " </CustomTable>", | ||
| 114 | " </Fragment>", | ||
| 115 | "</Wix>" | ||
| 116 | }; | ||
| 117 | |||
| 118 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | ||
| 119 | |||
| 120 | var messaging = new MockMessaging(); | ||
| 121 | var converter = new Wix3Converter(messaging, 2, null, null); | ||
| 122 | |||
| 123 | var errors = converter.ConvertDocument(document); | ||
| 124 | Assert.Equal(3, errors); | ||
| 125 | |||
| 126 | var actualLines = UnformattedDocumentLines(document); | ||
| 127 | CompareLineByLine(expected, actualLines); | ||
| 128 | } | ||
| 129 | |||
| 130 | [Fact] | ||
| 131 | public void FixCustomRowWithoutValue() | ||
| 132 | { | ||
| 133 | var parse = String.Join(Environment.NewLine, | ||
| 134 | "<?xml version=\"1.0\" encoding=\"utf-16\"?>", | ||
| 135 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>", | ||
| 136 | " <Fragment>", | ||
| 137 | " <CustomTable Id='Custom1'>", | ||
| 138 | " <Row Id='Column1'></Row>", | ||
| 139 | " </CustomTable>", | ||
| 140 | " </Fragment>", | ||
| 141 | "</Wix>"); | ||
| 142 | |||
| 143 | var expected = new[] | ||
| 144 | { | ||
| 145 | "<?xml version=\"1.0\" encoding=\"utf-16\"?>", | ||
| 146 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | ||
| 147 | " <Fragment>", | ||
| 148 | " <CustomTable Id=\"Custom1\">", | ||
| 149 | " <Row Id=\"Column1\"></Row>", | ||
| 150 | " </CustomTable>", | ||
| 151 | " </Fragment>", | ||
| 152 | "</Wix>" | ||
| 153 | }; | ||
| 154 | |||
| 155 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | ||
| 156 | |||
| 157 | var messaging = new MockMessaging(); | ||
| 158 | var converter = new Wix3Converter(messaging, 2, null, null); | ||
| 159 | |||
| 160 | var errors = converter.ConvertDocument(document); | ||
| 161 | Assert.Equal(2, errors); | ||
| 162 | |||
| 163 | var actualLines = UnformattedDocumentLines(document); | ||
| 164 | CompareLineByLine(expected, actualLines); | ||
| 165 | } | ||
| 166 | |||
| 167 | [Fact] | ||
| 168 | public void CanConvertCustomTableBootstrapperApplicationData() | ||
| 169 | { | ||
| 170 | var parse = String.Join(Environment.NewLine, | ||
| 171 | "<?xml version='1.0' encoding='utf-8'?>", | ||
| 172 | "<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>", | ||
| 173 | " <CustomTable Id='FgAppx' BootstrapperApplicationData='yes' />", | ||
| 174 | "</Wix>"); | ||
| 175 | |||
| 176 | var expected = String.Join(Environment.NewLine, | ||
| 177 | "<?xml version=\"1.0\" encoding=\"utf-16\"?>", | ||
| 178 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | ||
| 179 | " <CustomTable Id=\"FgAppx\" Unreal=\"yes\" />", | ||
| 180 | "</Wix>"); | ||
| 181 | |||
| 182 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | ||
| 183 | |||
| 184 | var messaging = new MockMessaging(); | ||
| 185 | var converter = new Wix3Converter(messaging, 2, null, null); | ||
| 186 | |||
| 187 | var errors = converter.ConvertDocument(document); | ||
| 188 | |||
| 189 | var actual = UnformattedDocumentString(document); | ||
| 190 | |||
| 191 | Assert.Equal(1, errors); | ||
| 192 | Assert.Equal(expected, actual); | ||
| 193 | } | ||
| 49 | } | 194 | } |
| 50 | } | 195 | } |
