diff options
Diffstat (limited to '')
-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 | } |