main
cs 30 lines 1.16 KB
Raw
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 WixInternal.TestSupport;
6 using WixToolset.Data.WindowsInstaller;
7 using Xunit;
8
9 public class WindowsInstallerTableDefinitionsFixture
10 {
11 [Fact]
12 public void CanCreateWindowsInstallerRows()
13 {
14 foreach (var tableDefinition in WindowsInstallerTableDefinitions.All)
15 {
16 var table = new Table(tableDefinition);
17 var rowFromTable = table.CreateRow(null);
18 var rowFromTableDefinition = tableDefinition.CreateRow(null);
19 var expectedRowTypeName = tableDefinition.Name.Replace("_", "") + "Row";
20 var expectedRowType = rowFromTable.GetType();
21
22 Assert.Equal(expectedRowType, rowFromTableDefinition.GetType());
23 if (typeof(Row) != expectedRowType)
24 {
25 WixAssert.StringEqual(expectedRowTypeName, expectedRowType.Name);
26 }
27 }
28 }
29 }
30 }