From 594bb035b8f27d341c982dc0754589a447b9abd6 Mon Sep 17 00:00:00 2001
From: Bob Arnson <bob@firegiant.com>
Date: Sun, 18 Apr 2021 21:09:37 -0400
Subject: Add `Wix4` table prefixes.

Per https://github.com/wixtoolset/issues/issues/5933.
---
 src/test/WixToolsetTest.Sql/SqlExtensionFixture.cs           | 12 ++++++++----
 .../TestData/UsingSql/PackageComponents.wxs                  | 12 ++++++++++--
 2 files changed, 18 insertions(+), 6 deletions(-)

(limited to 'src/test/WixToolsetTest.Sql')

diff --git a/src/test/WixToolsetTest.Sql/SqlExtensionFixture.cs b/src/test/WixToolsetTest.Sql/SqlExtensionFixture.cs
index 7d51c0fb..aa9d7a1f 100644
--- a/src/test/WixToolsetTest.Sql/SqlExtensionFixture.cs
+++ b/src/test/WixToolsetTest.Sql/SqlExtensionFixture.cs
@@ -11,15 +11,19 @@ namespace WixToolsetTest.Sql
     public class SqlExtensionFixture
     {
         [Fact]
-        public void CanBuildUsingSqlString()
+        public void CanBuildUsingSqlStuff()
         {
             var folder = TestData.Get(@"TestData\UsingSql");
             var build = new Builder(folder, typeof(SqlExtensionFactory), new[] { folder });
 
-            var results = build.BuildAndQuery(Build, "SqlString");
-            Assert.Equal(new[]
+            var results = build.BuildAndQuery(Build, "Wix4SqlDatabase", "Wix4SqlFileSpec", "Wix4SqlScript", "Wix4SqlString");
+            WixAssert.CompareLineByLine(new[]
             {
-                "SqlString:TestString\tTestDB\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tCREATE TABLE TestTable1(name varchar(20), value varchar(20))\t\t1\t",
+                "Wix4SqlDatabase:TestDB\tMySQLHostName\tMyInstanceName\tMyDB\tDatabaseComponent\t\tTestFileSpecId\tTestLogFileSpecId\t35",
+                "Wix4SqlFileSpec:TestFileSpecId\tTestFileSpecLogicalName\tTestFileSpec\t10MB\t100MB\t10%",
+                "Wix4SqlFileSpec:TestLogFileSpecId\tTestLogFileSpecLogicalName\tTestLogFileSpec\t1MB\t10MB\t1%",
+                "Wix4SqlScript:TestScript\tTestDB\tDatabaseComponent\tScriptBinary\t\t1\t",
+                "Wix4SqlString:TestString\tTestDB\tDatabaseComponent\tCREATE TABLE TestTable1(name varchar(20), value varchar(20))\t\t1\t",
             }, results.ToArray());
         }
 
diff --git a/src/test/WixToolsetTest.Sql/TestData/UsingSql/PackageComponents.wxs b/src/test/WixToolsetTest.Sql/TestData/UsingSql/PackageComponents.wxs
index 653f7e02..f7626926 100644
--- a/src/test/WixToolsetTest.Sql/TestData/UsingSql/PackageComponents.wxs
+++ b/src/test/WixToolsetTest.Sql/TestData/UsingSql/PackageComponents.wxs
@@ -2,12 +2,20 @@
 <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
      xmlns:sql="http://wixtoolset.org/schemas/v4/wxs/sql">
   <Fragment>
+    <Binary Id="ScriptBinary" SourceFile="example.txt" />
+
     <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
-        <Component>
-            <File Source="example.txt" />
+        <Component Id="DatabaseComponent" Guid="{322802E7-D65E-4C91-924F-FC6D30FEEB34}">
+            <File Id="TestFileSpec" Source="example.txt" />
+            <File Id="TestLogFileSpec" Source="example.txt" />
+
             <sql:SqlDatabase Id="TestDB" Database="MyDB" Server="MySQLHostName" Instance="MyInstanceName" CreateOnInstall="yes" DropOnUninstall="yes" ConfirmOverwrite="yes">
                 <sql:SqlString Id="TestString" SQL="CREATE TABLE TestTable1(name varchar(20), value varchar(20))" ExecuteOnInstall="yes" />
+                <sql:SqlFileSpec Id="TestFileSpecId" Filename="TestFileSpec" Name="TestFileSpecLogicalName" Size="10MB" GrowthSize="10%" MaxSize="100MB" />
+                <sql:SqlLogFileSpec Id="TestLogFileSpecId" Filename="TestLogFileSpec" Name="TestLogFileSpecLogicalName" Size="1MB" GrowthSize="1%" MaxSize="10MB" />
             </sql:SqlDatabase>
+
+            <sql:SqlScript Id="TestScript" BinaryRef="ScriptBinary" SqlDb="TestDB" ExecuteOnInstall="yes" />
         </Component>
     </ComponentGroup>
   </Fragment>
-- 
cgit v1.2.3-55-g6feb

