From 1c933963d1354495d4a31a08baf7f1240b5fbfce Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sat, 18 Apr 2020 13:53:54 +1000 Subject: Add ability for an extension to have a custom strongly typed row during binding. Remove some unused functionality in Table and Row. Use strongRowType in core tables. --- .../WindowsInstallerTableDefinitionsFixture.cs | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/test/WixToolsetTest.Data/WindowsInstallerTableDefinitionsFixture.cs (limited to 'src/test/WixToolsetTest.Data/WindowsInstallerTableDefinitionsFixture.cs') diff --git a/src/test/WixToolsetTest.Data/WindowsInstallerTableDefinitionsFixture.cs b/src/test/WixToolsetTest.Data/WindowsInstallerTableDefinitionsFixture.cs new file mode 100644 index 00000000..5621a756 --- /dev/null +++ b/src/test/WixToolsetTest.Data/WindowsInstallerTableDefinitionsFixture.cs @@ -0,0 +1,29 @@ +// 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. + +namespace WixToolsetTest.Data +{ + using WixToolset.Data.WindowsInstaller; + using Xunit; + + public class WindowsInstallerTableDefinitionsFixture + { + [Fact] + public void CanCreateWindowsInstallerRows() + { + foreach (var tableDefinition in WindowsInstallerTableDefinitions.All) + { + var table = new Table(tableDefinition); + var rowFromTable = table.CreateRow(null); + var rowFromTableDefinition = tableDefinition.CreateRow(null); + var expectedRowTypeName = tableDefinition.Name.Replace("_", "") + "Row"; + var expectedRowType = rowFromTable.GetType(); + + Assert.Equal(expectedRowType, rowFromTableDefinition.GetType()); + if (typeof(Row) != expectedRowType) + { + Assert.Equal(expectedRowTypeName, expectedRowType.Name); + } + } + } + } +} -- cgit v1.2.3-55-g6feb