diff options
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs')
-rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs | 137 |
1 files changed, 137 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs index 7c53d72f..e7443f35 100644 --- a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs | |||
@@ -10,6 +10,143 @@ namespace WixToolsetTest.CoreIntegration | |||
10 | public class MsiQueryFixture | 10 | public class MsiQueryFixture |
11 | { | 11 | { |
12 | [Fact(Skip = "Test demonstrates failure")] | 12 | [Fact(Skip = "Test demonstrates failure")] |
13 | public void PopulatesAppSearchTablesFromComponentSearch() | ||
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, "AppSearch", "ComponentSearch.wxs"), | ||
27 | Path.Combine(folder, "ProductWithComponentGroupRef", "MinimalComponentGroup.wxs"), | ||
28 | Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), | ||
29 | "-bindpath", Path.Combine(folder, "SingleFile", "data"), | ||
30 | "-intermediateFolder", intermediateFolder, | ||
31 | "-o", msiPath | ||
32 | }); | ||
33 | |||
34 | result.AssertSuccess(); | ||
35 | |||
36 | Assert.True(File.Exists(msiPath)); | ||
37 | var results = Query.QueryDatabase(msiPath, new[] { "AppSearch", "CompLocator" }); | ||
38 | Assert.Equal(new[] | ||
39 | { | ||
40 | "AppSearch:SAMPLECOMPFOUND\tSampleCompSearch", | ||
41 | "CompLocator:SampleCompSearch\t{4D9A0D20-D0CC-40DE-B580-EAD38B985217}\t1", | ||
42 | }, results); | ||
43 | } | ||
44 | } | ||
45 | |||
46 | [Fact(Skip = "Test demonstrates failure")] | ||
47 | public void PopulatesAppSearchTablesFromDirectorySearch() | ||
48 | { | ||
49 | var folder = TestData.Get(@"TestData"); | ||
50 | |||
51 | using (var fs = new DisposableFileSystem()) | ||
52 | { | ||
53 | var baseFolder = fs.GetFolder(); | ||
54 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
55 | var msiPath = Path.Combine(baseFolder, @"bin\test.msi"); | ||
56 | |||
57 | var result = WixRunner.Execute(new[] | ||
58 | { | ||
59 | "build", | ||
60 | Path.Combine(folder, "AppSearch", "DirectorySearch.wxs"), | ||
61 | Path.Combine(folder, "ProductWithComponentGroupRef", "MinimalComponentGroup.wxs"), | ||
62 | Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), | ||
63 | "-bindpath", Path.Combine(folder, "SingleFile", "data"), | ||
64 | "-intermediateFolder", intermediateFolder, | ||
65 | "-o", msiPath | ||
66 | }); | ||
67 | |||
68 | result.AssertSuccess(); | ||
69 | |||
70 | Assert.True(File.Exists(msiPath)); | ||
71 | var results = Query.QueryDatabase(msiPath, new[] { "AppSearch", "DrLocator" }); | ||
72 | Assert.Equal(new[] | ||
73 | { | ||
74 | "AppSearch:SAMPLECOMPFOUND\tSampleCompSearch", | ||
75 | "DrLocator:SampleDirSearch\t\tC:\\SampleDir\t", | ||
76 | }, results); | ||
77 | } | ||
78 | } | ||
79 | |||
80 | [Fact(Skip = "Test demonstrates failure")] | ||
81 | public void PopulatesAppSearchTablesFromFileSearch() | ||
82 | { | ||
83 | var folder = TestData.Get(@"TestData"); | ||
84 | |||
85 | using (var fs = new DisposableFileSystem()) | ||
86 | { | ||
87 | var baseFolder = fs.GetFolder(); | ||
88 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
89 | var msiPath = Path.Combine(baseFolder, @"bin\test.msi"); | ||
90 | |||
91 | var result = WixRunner.Execute(new[] | ||
92 | { | ||
93 | "build", | ||
94 | Path.Combine(folder, "AppSearch", "FileSearch.wxs"), | ||
95 | Path.Combine(folder, "ProductWithComponentGroupRef", "MinimalComponentGroup.wxs"), | ||
96 | Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), | ||
97 | "-bindpath", Path.Combine(folder, "SingleFile", "data"), | ||
98 | "-intermediateFolder", intermediateFolder, | ||
99 | "-o", msiPath | ||
100 | }); | ||
101 | |||
102 | result.AssertSuccess(); | ||
103 | |||
104 | Assert.True(File.Exists(msiPath)); | ||
105 | var results = Query.QueryDatabase(msiPath, new[] { "AppSearch", "DrLocator", "IniLocator" }); | ||
106 | Assert.Equal(new[] | ||
107 | { | ||
108 | "AppSearch:SAMPLEFILEFOUND\tSampleFileSearch", | ||
109 | "DrLocator:SampleFileSearch\tSampleIniFileSearch\t\t", | ||
110 | "IniLocator:SampleFileSearch\tsample.fil\tMySection\tMyKey\t\t1", | ||
111 | }, results); | ||
112 | } | ||
113 | } | ||
114 | |||
115 | [Fact(Skip = "Test demonstrates failure")] | ||
116 | public void PopulatesAppSearchTablesFromRegistrySearch() | ||
117 | { | ||
118 | var folder = TestData.Get(@"TestData"); | ||
119 | |||
120 | using (var fs = new DisposableFileSystem()) | ||
121 | { | ||
122 | var baseFolder = fs.GetFolder(); | ||
123 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
124 | var msiPath = Path.Combine(baseFolder, @"bin\test.msi"); | ||
125 | |||
126 | var result = WixRunner.Execute(new[] | ||
127 | { | ||
128 | "build", | ||
129 | Path.Combine(folder, "AppSearch", "RegistrySearch.wxs"), | ||
130 | Path.Combine(folder, "ProductWithComponentGroupRef", "MinimalComponentGroup.wxs"), | ||
131 | Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), | ||
132 | "-bindpath", Path.Combine(folder, "SingleFile", "data"), | ||
133 | "-intermediateFolder", intermediateFolder, | ||
134 | "-o", msiPath | ||
135 | }); | ||
136 | |||
137 | result.AssertSuccess(); | ||
138 | |||
139 | Assert.True(File.Exists(msiPath)); | ||
140 | var results = Query.QueryDatabase(msiPath, new[] { "AppSearch", "RegLocator" }); | ||
141 | Assert.Equal(new[] | ||
142 | { | ||
143 | "AppSearch:SAMPLEREGFOUND\tSampleRegSearch", | ||
144 | "RegLocator:SampleRegSearch\t2\tSampleReg\t\t2", | ||
145 | }, results); | ||
146 | } | ||
147 | } | ||
148 | |||
149 | [Fact(Skip = "Test demonstrates failure")] | ||
13 | public void PopulatesDirectoryTableWithValidDefaultDir() | 150 | public void PopulatesDirectoryTableWithValidDefaultDir() |
14 | { | 151 | { |
15 | var folder = TestData.Get(@"TestData"); | 152 | var folder = TestData.Get(@"TestData"); |