diff options
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs')
-rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs new file mode 100644 index 00000000..82934b9a --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs | |||
@@ -0,0 +1,54 @@ | |||
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.CoreIntegration | ||
4 | { | ||
5 | using System.IO; | ||
6 | using WixBuildTools.TestSupport; | ||
7 | using WixToolset.Core.TestPackage; | ||
8 | using Xunit; | ||
9 | |||
10 | public class MsiQueryFixture | ||
11 | { | ||
12 | [Fact(Skip = "Test demonstrates failure")] | ||
13 | public void PopulatesDirectoryTableWithValidDefaultDir() | ||
14 | { | ||
15 | var folder = TestData.Get(@"TestData"); | ||
16 | |||
17 | using (var fs = new DisposableFileSystem()) | ||
18 | { | ||
19 | var baseFolder = fs.GetFolder(); | ||
20 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
21 | var msiPath = Path.Combine(baseFolder, @"bin\test.msi"); | ||
22 | |||
23 | var result = WixRunner.Execute(new[] | ||
24 | { | ||
25 | "build", | ||
26 | Path.Combine(folder, "DefaultDir", "DefaultDir.wxs"), | ||
27 | Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), | ||
28 | "-bindpath", Path.Combine(folder, "SingleFile", "data"), | ||
29 | "-intermediateFolder", intermediateFolder, | ||
30 | "-o", msiPath | ||
31 | }); | ||
32 | |||
33 | result.AssertSuccess(); | ||
34 | |||
35 | Assert.True(File.Exists(msiPath)); | ||
36 | var results = Query.QueryDatabase(msiPath, new[] { "Directory" }); | ||
37 | Assert.Equal(new[] | ||
38 | { | ||
39 | "Directory:INSTALLFOLDER\tProgramFilesFolder\toekcr5lq|MsiPackage", | ||
40 | "Directory:NAMEANDSHORTNAME\tINSTALLFOLDER\tSHORTNAM|NameAndShortName", | ||
41 | "Directory:NAMEANDSHORTSOURCENAME\tINSTALLFOLDER\tNAMEASSN|NameAndShortSourceName", | ||
42 | "Directory:NAMEWITHSHORTVALUE\tINSTALLFOLDER\tSHORTVAL", | ||
43 | "Directory:ProgramFilesFolder\tTARGETDIR\t.", | ||
44 | "Directory:SHORTNAMEANDLONGSOURCENAME\tINSTALLFOLDER\tSHNALSNM:6ukthv5q|ShortNameAndLongSourceName", | ||
45 | "Directory:SHORTNAMEONLY\tINSTALLFOLDER\tSHORTONL", | ||
46 | "Directory:SOURCENAME\tINSTALLFOLDER\ts2s5bq-i|NameAndSourceName:dhnqygng|SourceNameWithName", | ||
47 | "Directory:SOURCENAMESONLY\tINSTALLFOLDER\t.:SRCNAMON|SourceNameOnly", | ||
48 | "Directory:SOURCENAMEWITHSHORTVALUE\tINSTALLFOLDER\t.:SRTSRCVL", | ||
49 | "Directory:TARGETDIR\t\tSourceDir", | ||
50 | }, results); | ||
51 | } | ||
52 | } | ||
53 | } | ||
54 | } | ||