diff options
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration/BundleManifestFixture.cs')
-rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/BundleManifestFixture.cs | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/BundleManifestFixture.cs b/src/test/WixToolsetTest.CoreIntegration/BundleManifestFixture.cs new file mode 100644 index 00000000..da4482ff --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/BundleManifestFixture.cs | |||
@@ -0,0 +1,61 @@ | |||
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.Collections.Generic; | ||
6 | using System.IO; | ||
7 | using WixBuildTools.TestSupport; | ||
8 | using WixToolset.Core.TestPackage; | ||
9 | using Xunit; | ||
10 | |||
11 | public class BundleManifestFixture | ||
12 | { | ||
13 | [Fact] | ||
14 | public void PopulatesManifestWithBundleExtension() | ||
15 | { | ||
16 | var burnStubPath = TestData.Get(@"TestData\.Data\burn.exe"); | ||
17 | var folder = TestData.Get(@"TestData"); | ||
18 | |||
19 | using (var fs = new DisposableFileSystem()) | ||
20 | { | ||
21 | var baseFolder = fs.GetFolder(); | ||
22 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
23 | var bundlePath = Path.Combine(baseFolder, @"bin\test.exe"); | ||
24 | var baFolderPath = Path.Combine(baseFolder, "ba"); | ||
25 | var extractFolderPath = Path.Combine(baseFolder, "extract"); | ||
26 | |||
27 | var result = WixRunner.Execute(new[] | ||
28 | { | ||
29 | "build", | ||
30 | Path.Combine(folder, "BundleExtension", "BundleExtension.wxs"), | ||
31 | Path.Combine(folder, "BundleExtension", "SimpleBundleExtension.wxs"), | ||
32 | Path.Combine(folder, "BundleWithPackageGroupRef", "MinimalPackageGroup.wxs"), | ||
33 | Path.Combine(folder, "BundleWithPackageGroupRef", "Bundle.wxs"), | ||
34 | "-bindpath", Path.Combine(folder, "SimpleBundle", "data"), | ||
35 | "-intermediateFolder", intermediateFolder, | ||
36 | "-burnStub", burnStubPath, | ||
37 | "-o", bundlePath | ||
38 | }); | ||
39 | |||
40 | result.AssertSuccess(); | ||
41 | |||
42 | Assert.True(File.Exists(bundlePath)); | ||
43 | |||
44 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); | ||
45 | extractResult.AssertSuccess(); | ||
46 | |||
47 | var bundleExtensions = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:BundleExtension"); | ||
48 | Assert.Equal(1, bundleExtensions.Count); | ||
49 | Assert.Equal("<BundleExtension Id='ExampleBext' EntryPayloadId='ExampleBext' />", bundleExtensions[0].GetTestXml()); | ||
50 | |||
51 | var bundleExtensionPayloads = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:UX/burn:Payload[@Id='ExampleBext']"); | ||
52 | Assert.Equal(1, bundleExtensionPayloads.Count); | ||
53 | var ignored = new Dictionary<string, List<string>> | ||
54 | { | ||
55 | { "Payload", new List<string> { "FileSize", "Hash", "SourcePath" } }, | ||
56 | }; | ||
57 | Assert.Equal("<Payload Id='ExampleBext' FilePath='fakebext.dll' FileSize='*' Hash='*' Packaging='embedded' SourcePath='*' />", bundleExtensionPayloads[0].GetTestXml(ignored)); | ||
58 | } | ||
59 | } | ||
60 | } | ||
61 | } | ||