aboutsummaryrefslogtreecommitdiff
path: root/src/test/WixToolsetTest.CoreIntegration/BundleExtractionFixture.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration/BundleExtractionFixture.cs')
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/BundleExtractionFixture.cs57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/BundleExtractionFixture.cs b/src/test/WixToolsetTest.CoreIntegration/BundleExtractionFixture.cs
new file mode 100644
index 00000000..5c37c25b
--- /dev/null
+++ b/src/test/WixToolsetTest.CoreIntegration/BundleExtractionFixture.cs
@@ -0,0 +1,57 @@
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;
9 using WixToolset.Core.TestPackage;
10 using WixToolset.Data;
11 using Xunit;
12
13 public class BundleExtractionFixture
14 {
15 [Fact]
16 public void CanExtractBundleWithDetachedContainer()
17 {
18 var folder = TestData.Get(@"TestData");
19
20 using (var fs = new DisposableFileSystem())
21 {
22 var baseFolder = fs.GetFolder();
23 var intermediateFolder = Path.Combine(baseFolder, "obj");
24 var exePath = Path.Combine(baseFolder, @"bin\test.exe");
25 var pdbPath = Path.Combine(baseFolder, @"bin\test.wixpdb");
26 var extractFolderPath = Path.Combine(baseFolder, "extract");
27 var baFolderPath = Path.Combine(extractFolderPath, "UX");
28 var attachedContainerFolderPath = Path.Combine(extractFolderPath, "AttachedContainer");
29
30 // TODO: use WixRunner.Execute(string[]) to always go through the command line.
31 var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider();
32 var result = WixRunner.Execute(new[]
33 {
34 "build",
35 Path.Combine(folder, "BundleWithDetachedContainer", "Bundle.wxs"),
36 Path.Combine(folder, "BundleWithPackageGroupRef", "Bundle.wxs"),
37 Path.Combine(folder, "BundleWithPackageGroupRef", "MinimalPackageGroup.wxs"),
38 "-bindpath", Path.Combine(folder, "SimpleBundle", "data"),
39 "-bindpath", Path.Combine(folder, ".Data"),
40 "-intermediateFolder", intermediateFolder,
41 "-o", exePath,
42 }, serviceProvider, out var messages).Result;
43
44 WixRunnerResult.AssertSuccess(result, messages);
45 Assert.Empty(messages.Where(m => m.Level == MessageLevel.Warning));
46
47 Assert.True(File.Exists(exePath));
48
49 var unbinder = serviceProvider.GetService<IUnbinder>();
50 unbinder.Unbind(exePath, OutputType.Bundle, extractFolderPath);
51
52 Assert.True(File.Exists(Path.Combine(baFolderPath, "manifest.xml")));
53 Assert.False(Directory.Exists(attachedContainerFolderPath));
54 }
55 }
56 }
57}