diff options
Diffstat (limited to 'src/api/wix/test/WixToolsetTest.Data/WindowsInstallerTableDefinitionsFixture.cs')
| -rw-r--r-- | src/api/wix/test/WixToolsetTest.Data/WindowsInstallerTableDefinitionsFixture.cs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/api/wix/test/WixToolsetTest.Data/WindowsInstallerTableDefinitionsFixture.cs b/src/api/wix/test/WixToolsetTest.Data/WindowsInstallerTableDefinitionsFixture.cs new file mode 100644 index 00000000..5621a756 --- /dev/null +++ b/src/api/wix/test/WixToolsetTest.Data/WindowsInstallerTableDefinitionsFixture.cs | |||
| @@ -0,0 +1,29 @@ | |||
| 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.Data | ||
| 4 | { | ||
| 5 | using WixToolset.Data.WindowsInstaller; | ||
| 6 | using Xunit; | ||
| 7 | |||
| 8 | public class WindowsInstallerTableDefinitionsFixture | ||
| 9 | { | ||
| 10 | [Fact] | ||
| 11 | public void CanCreateWindowsInstallerRows() | ||
| 12 | { | ||
| 13 | foreach (var tableDefinition in WindowsInstallerTableDefinitions.All) | ||
| 14 | { | ||
| 15 | var table = new Table(tableDefinition); | ||
| 16 | var rowFromTable = table.CreateRow(null); | ||
| 17 | var rowFromTableDefinition = tableDefinition.CreateRow(null); | ||
| 18 | var expectedRowTypeName = tableDefinition.Name.Replace("_", "") + "Row"; | ||
| 19 | var expectedRowType = rowFromTable.GetType(); | ||
| 20 | |||
| 21 | Assert.Equal(expectedRowType, rowFromTableDefinition.GetType()); | ||
| 22 | if (typeof(Row) != expectedRowType) | ||
| 23 | { | ||
| 24 | Assert.Equal(expectedRowTypeName, expectedRowType.Name); | ||
| 25 | } | ||
| 26 | } | ||
| 27 | } | ||
| 28 | } | ||
| 29 | } | ||
