aboutsummaryrefslogtreecommitdiff
path: root/src/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2018-10-24 21:06:51 -0700
committerRob Mensching <rob@robmensching.com>2018-10-24 21:17:34 -0700
commit822d917960cbd35f506598af4baa6a20ad4b447e (patch)
tree0d4cf39e25f5fe213bbeac2fb546d2aa86b172db /src/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs
parent7a2859709034f7f4f048a0757779a6e2fee6df5b (diff)
downloadwix-822d917960cbd35f506598af4baa6a20ad4b447e.tar.gz
wix-822d917960cbd35f506598af4baa6a20ad4b447e.tar.bz2
wix-822d917960cbd35f506598af4baa6a20ad4b447e.zip
Re-introduce "decompile" to backend
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs')
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs b/src/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs
new file mode 100644
index 00000000..66ce98c0
--- /dev/null
+++ b/src/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs
@@ -0,0 +1,41 @@
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.Xml.Linq;
7 using WixBuildTools.TestSupport;
8 using WixToolset.Core.TestPackage;
9 using Xunit;
10
11 public class DecompileFixture
12 {
13 [Fact]
14 public void CanDecompileSingleFileCompressed()
15 {
16 var folder = TestData.Get(@"TestData\DecompileSingleFileCompressed");
17
18 using (var fs = new DisposableFileSystem())
19 {
20 var intermediateFolder = fs.GetFolder();
21 var outputPath = Path.Combine(intermediateFolder, @"Actual.wxs");
22
23 var result = WixRunner.Execute(new[]
24 {
25 "decompile",
26 Path.Combine(folder, "example.msi"),
27 "-intermediateFolder", intermediateFolder,
28 "-o", outputPath
29 });
30
31 result.AssertSuccess();
32
33 var actual = File.ReadAllText(outputPath);
34 var actualFormatted = XDocument.Parse(actual, LoadOptions.PreserveWhitespace | LoadOptions.SetBaseUri | LoadOptions.SetLineInfo).ToString();
35 var expected = XDocument.Load(Path.Combine(folder, "Expected.wxs"), LoadOptions.PreserveWhitespace | LoadOptions.SetBaseUri | LoadOptions.SetLineInfo).ToString();
36
37 Assert.Equal(expected, actualFormatted);
38 }
39 }
40 }
41}