aboutsummaryrefslogtreecommitdiff
path: root/src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs')
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs81
1 files changed, 0 insertions, 81 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs b/src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs
deleted file mode 100644
index 57351b27..00000000
--- a/src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs
+++ /dev/null
@@ -1,81 +0,0 @@
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
3namespace 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.Symbols;
11 using Xunit;
12
13 public class WixlibQueryFixture
14 {
15 [Fact]
16 public void UpgradeProducesReferenceToRemoveExistingProducts()
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 var wixlibPath = Path.Combine(intermediateFolder, @"test.wixlib");
25
26 var result = WixRunner.Execute(new[]
27 {
28 "build",
29 Path.Combine(folder, "DetectOnly.wxs"),
30 "-intermediateFolder", intermediateFolder,
31 "-o", wixlibPath,
32 });
33
34 result.AssertSuccess();
35
36 var intermediate = Intermediate.Load(wixlibPath);
37 var allSymbols = intermediate.Sections.SelectMany(s => s.Symbols);
38 var wixSimpleRefSymbols = allSymbols.OfType<WixSimpleReferenceSymbol>();
39 var repRef = wixSimpleRefSymbols.Where(t => t.Table == "WixAction" &&
40 t.PrimaryKeys == "InstallExecuteSequence/RemoveExistingProducts")
41 .SingleOrDefault();
42 Assert.NotNull(repRef);
43 }
44 }
45
46 [Fact]
47 public void TypeLibLanguageAsStringReturnsZero()
48 {
49 var folder = TestData.Get(@"TestData\TypeLib");
50
51 using (var fs = new DisposableFileSystem())
52 {
53 var baseFolder = fs.GetFolder();
54 var intermediateFolder = Path.Combine(baseFolder, "obj");
55 var wixlibPath = Path.Combine(intermediateFolder, @"test.wixlib");
56
57 var result = WixRunner.Execute(new[]
58 {
59 "build",
60 Path.Combine(folder, "Language0.wxs"),
61 "-intermediateFolder", intermediateFolder,
62 "-o", wixlibPath
63 });
64
65 result.AssertSuccess();
66
67 var intermediate = Intermediate.Load(wixlibPath);
68 var allSymbols = intermediate.Sections.SelectMany(s => s.Symbols);
69 var typeLibSymbol = allSymbols.OfType<TypeLibSymbol>()
70 .SingleOrDefault();
71 Assert.NotNull(typeLibSymbol);
72
73 var fields = typeLibSymbol.Fields.Select(field => field?.Type == IntermediateFieldType.Bool
74 ? field.AsNullableNumber()?.ToString()
75 : field?.AsString())
76 .ToList();
77 Assert.Equal("0", fields[1]);
78 }
79 }
80 }
81}