diff options
| author | Nir Bar <nir.bar@panel-sw.co.il> | 2020-12-21 05:05:45 -0600 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2020-12-21 16:49:04 -0600 |
| commit | d085e938317c80f62a3b484d20ed1a6cf89bb59d (patch) | |
| tree | d993e2bf90bc754d62b9731981b3cb056e1bb7b9 /src/test/WixToolsetTest.CoreIntegration/BundleExtractionFixture.cs | |
| parent | 85deb61f666f6817c1a137ace4d666c8ae2940fb (diff) | |
| download | wix-d085e938317c80f62a3b484d20ed1a6cf89bb59d.tar.gz wix-d085e938317c80f62a3b484d20ed1a6cf89bb59d.tar.bz2 wix-d085e938317c80f62a3b484d20ed1a6cf89bb59d.zip | |
Add CanExtractBundleWithDetachedContainer test.
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration/BundleExtractionFixture.cs')
| -rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/BundleExtractionFixture.cs | 57 |
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 | |||
| 3 | namespace 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 | } | ||
