| 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.Sql |
| 4 | { |
| 5 | using System.Linq; |
| 6 | using WixInternal.TestSupport; |
| 7 | using WixInternal.Core.TestPackage; |
| 8 | using WixToolset.Sql; |
| 9 | using Xunit; |
| 10 | |
| 11 | public class SqlExtensionFixture |
| 12 | { |
| 13 | [Fact] |
| 14 | public void CanBuildUsingSqlStuff() |
| 15 | { |
| 16 | var folder = TestData.Get(@"TestData\UsingSql"); |
| 17 | var build = new Builder(folder, typeof(SqlExtensionFactory), new[] { folder }); |
| 18 | |
| 19 | var results = build.BuildAndQuery(Build, "Wix4SqlDatabase", "Wix4SqlFileSpec", "Wix4SqlScript", "Wix4SqlString"); |
| 20 | WixAssert.CompareLineByLine(new[] |
| 21 | { |
| 22 | "Wix4SqlDatabase:TestDB\tMySQLHostName\tMyInstanceName\tMyDB\tDatabaseComponent\t\tTestFileSpecId\tTestLogFileSpecId\t35", |
| 23 | "Wix4SqlFileSpec:TestFileSpecId\tTestFileSpecLogicalName\tTestFileSpec\t10MB\t100MB\t10%", |
| 24 | "Wix4SqlFileSpec:TestLogFileSpecId\tTestLogFileSpecLogicalName\tTestLogFileSpec\t1MB\t10MB\t1%", |
| 25 | "Wix4SqlScript:TestScript\tTestDB\tDatabaseComponent\tScriptBinary\t\t1\t", |
| 26 | "Wix4SqlString:TestString\tTestDB\tDatabaseComponent\tCREATE TABLE TestTable1(name varchar(20), value varchar(20))\t\t1\t", |
| 27 | }, results.ToArray()); |
| 28 | } |
| 29 | |
| 30 | private static void Build(string[] args) |
| 31 | { |
| 32 | var result = WixRunner.Execute(args) |
| 33 | .AssertSuccess(); |
| 34 | } |
| 35 | } |
| 36 | } |