diff options
author | Bevan Weiss <bevan.weiss@gmail.com> | 2025-01-18 23:01:30 +1100 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2025-03-03 06:35:56 -0800 |
commit | 61d789db5de8613c51df1e7db94f459aadbd3ca8 (patch) | |
tree | be35d8cddab1d70df621949afd5ef84456602a37 /src/ext/Msmq/test/WixToolsetTest.Msmq/MsmqExtensionFixture.cs | |
parent | 3b9efe831c6a408cd71a7bea6fa95f65c141911b (diff) | |
download | wix-61d789db5de8613c51df1e7db94f459aadbd3ca8.tar.gz wix-61d789db5de8613c51df1e7db94f459aadbd3ca8.tar.bz2 wix-61d789db5de8613c51df1e7db94f459aadbd3ca8.zip |
Add a basic unit test for the round msmq decompiler round trip.
Needed fix up for Group decompiler to work correctly, adding to Index,
and fixing where the Group name column is located.
Signed-off-by: Bevan Weiss <bevan.weiss@gmail.com>
Diffstat (limited to 'src/ext/Msmq/test/WixToolsetTest.Msmq/MsmqExtensionFixture.cs')
-rw-r--r-- | src/ext/Msmq/test/WixToolsetTest.Msmq/MsmqExtensionFixture.cs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/ext/Msmq/test/WixToolsetTest.Msmq/MsmqExtensionFixture.cs b/src/ext/Msmq/test/WixToolsetTest.Msmq/MsmqExtensionFixture.cs index 424d3d5b..c89d138a 100644 --- a/src/ext/Msmq/test/WixToolsetTest.Msmq/MsmqExtensionFixture.cs +++ b/src/ext/Msmq/test/WixToolsetTest.Msmq/MsmqExtensionFixture.cs | |||
@@ -2,7 +2,10 @@ | |||
2 | 2 | ||
3 | namespace WixToolsetTest.Msmq | 3 | namespace WixToolsetTest.Msmq |
4 | { | 4 | { |
5 | using System.Data; | ||
6 | using System.IO; | ||
5 | using System.Linq; | 7 | using System.Linq; |
8 | using System.Xml.Linq; | ||
6 | using WixInternal.TestSupport; | 9 | using WixInternal.TestSupport; |
7 | using WixInternal.Core.TestPackage; | 10 | using WixInternal.Core.TestPackage; |
8 | using WixToolset.Msmq; | 11 | using WixToolset.Msmq; |
@@ -34,6 +37,29 @@ namespace WixToolsetTest.Msmq | |||
34 | }, results); | 37 | }, results); |
35 | } | 38 | } |
36 | 39 | ||
40 | [Fact] | ||
41 | public void CanRoundtripMessageQueue() | ||
42 | { | ||
43 | var folder = TestData.Get(@"TestData\UsingMessageQueue"); | ||
44 | var build = new Builder(folder, new[] { typeof(MsmqExtensionFactory), typeof(UtilExtensionFactory) }, new[] { folder }); | ||
45 | var output = Path.Combine(folder, "MessageQueueDecompile.xml"); | ||
46 | |||
47 | build.BuildAndDecompileAndBuild(Build, Decompile, output); | ||
48 | |||
49 | var doc = XDocument.Load(output); | ||
50 | var actual = doc.Descendants() | ||
51 | .Where(e => e.Name.Namespace == "http://wixtoolset.org/schemas/v4/wxs/msmq") | ||
52 | .Select(fe => new { Name = fe.Name.LocalName, Id = fe.Attributes().Where(a => a.Name == "Id").Select(a => a.Value).FirstOrDefault() }) | ||
53 | .ToArray(); | ||
54 | |||
55 | WixAssert.CompareLineByLine(new[] | ||
56 | { | ||
57 | "MessageQueue:TestMQ", | ||
58 | "MessageQueuePermission:TestMQ_TestUser", | ||
59 | "MessageQueuePermission:TestMQ_TestGroup", | ||
60 | }, actual.Select(a => $"{a.Name}:{a.Id}").ToArray()); | ||
61 | } | ||
62 | |||
37 | private static void Build(string[] args) | 63 | private static void Build(string[] args) |
38 | { | 64 | { |
39 | args = args.Concat(new[] { "-arch", "arm64" }).ToArray(); | 65 | args = args.Concat(new[] { "-arch", "arm64" }).ToArray(); |
@@ -41,5 +67,11 @@ namespace WixToolsetTest.Msmq | |||
41 | var result = WixRunner.Execute(args); | 67 | var result = WixRunner.Execute(args); |
42 | result.AssertSuccess(); | 68 | result.AssertSuccess(); |
43 | } | 69 | } |
70 | |||
71 | private static void Decompile(string[] args) | ||
72 | { | ||
73 | var result = WixRunner.Execute(args); | ||
74 | result.AssertSuccess(); | ||
75 | } | ||
44 | } | 76 | } |
45 | } | 77 | } |