diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2019-10-11 15:35:23 +1000 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2019-10-11 15:39:29 +1000 |
commit | 6aa87076310c0ad2cb92cabcf2e8bc83c22970be (patch) | |
tree | fe749fedaa1b3810c9b28d964aaaf5f9d5d96530 /src/test | |
parent | cef530d2414767fa8523dae4beb5de4db5edd6f5 (diff) | |
download | wix-6aa87076310c0ad2cb92cabcf2e8bc83c22970be.tar.gz wix-6aa87076310c0ad2cb92cabcf2e8bc83c22970be.tar.bz2 wix-6aa87076310c0ad2cb92cabcf2e8bc83c22970be.zip |
Add failing test around detect only Upgrade.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs b/src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs new file mode 100644 index 00000000..88491eac --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs | |||
@@ -0,0 +1,45 @@ | |||
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 System.Linq; | ||
7 | using WixBuildTools.TestSupport; | ||
8 | using WixToolset.Core.TestPackage; | ||
9 | using WixToolset.Data; | ||
10 | using WixToolset.Data.Tuples; | ||
11 | using Xunit; | ||
12 | |||
13 | public class WixlibQueryFixture | ||
14 | { | ||
15 | [Fact(Skip = "Test demonstrates failure")] | ||
16 | public void DetectOnlyUpgradeProducesReferenceToRemoveExistingProducts() | ||
17 | { | ||
18 | var folder = TestData.Get(@"TestData\Upgrade"); | ||
19 | |||
20 | using (var fs = new DisposableFileSystem()) | ||
21 | { | ||
22 | var baseFolder = fs.GetFolder(); | ||
23 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
24 | |||
25 | var result = WixRunner.Execute(new[] | ||
26 | { | ||
27 | "build", | ||
28 | Path.Combine(folder, "DetectOnly.wxs"), | ||
29 | "-intermediateFolder", intermediateFolder, | ||
30 | "-o", Path.Combine(intermediateFolder, @"test.wixlib"), | ||
31 | }); | ||
32 | |||
33 | result.AssertSuccess(); | ||
34 | |||
35 | var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"test.wixlib")); | ||
36 | var allTuples = intermediate.Sections.SelectMany(s => s.Tuples); | ||
37 | var wixSimpleRefTuples = allTuples.OfType<WixSimpleReferenceTuple>(); | ||
38 | var repRef = wixSimpleRefTuples.Where(t => t.Table == "WixAction" && | ||
39 | t.PrimaryKeys == "InstallExecuteSequence/RemoveExistingProducts") | ||
40 | .SingleOrDefault(); | ||
41 | Assert.NotNull(repRef); | ||
42 | } | ||
43 | } | ||
44 | } | ||
45 | } | ||