From 8cbfc326cccf8d9b3b63cb6f752fc770f7dee0fc Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Tue, 29 Jun 2021 19:14:02 -0500 Subject: Expose overridable variable APIs in balutil and Mba.Core. Fixes #4777 --- .../BaseBootstrapperApplicationFactoryFixture.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/api/burn/test/WixToolsetTest.Mba.Core') diff --git a/src/api/burn/test/WixToolsetTest.Mba.Core/BaseBootstrapperApplicationFactoryFixture.cs b/src/api/burn/test/WixToolsetTest.Mba.Core/BaseBootstrapperApplicationFactoryFixture.cs index aaf5ee29..b49b3927 100644 --- a/src/api/burn/test/WixToolsetTest.Mba.Core/BaseBootstrapperApplicationFactoryFixture.cs +++ b/src/api/burn/test/WixToolsetTest.Mba.Core/BaseBootstrapperApplicationFactoryFixture.cs @@ -3,6 +3,7 @@ namespace WixToolsetTest.Mba.Core { using System; + using System.Collections.Generic; using System.Runtime.InteropServices; using WixToolset.Mba.Core; using Xunit; @@ -17,7 +18,7 @@ namespace WixToolsetTest.Mba.Core action = LaunchAction.Install, cbSize = Marshal.SizeOf(typeof(TestCommand)), display = Display.Full, - wzCommandLine = "this \"is a\" test", + wzCommandLine = "this \"is a\" test VariableA=AVariable =EmptyName EmptyValue=", }; var pCommand = Marshal.AllocHGlobal(command.cbSize); try @@ -42,7 +43,15 @@ namespace WixToolsetTest.Mba.Core Assert.Equal(baFactory.BA, createResults.pBA); Assert.Equal(baFactory.BA.Command.Action, command.action); Assert.Equal(baFactory.BA.Command.Display, command.display); - Assert.Equal(baFactory.BA.Command.CommandLineArgs, new string[] { "this", "is a", "test" }); + + var mbaCommand = baFactory.BA.Command.ParseCommandLine(); + Assert.Equal(mbaCommand.UnknownCommandLineArgs, new string[] { "this", "is a", "test" }); + Assert.Equal(mbaCommand.Variables, new KeyValuePair[] + { + new KeyValuePair("VariableA", "AVariable"), + new KeyValuePair("", "EmptyName"), + new KeyValuePair("EmptyValue", ""), + }); } finally { -- cgit v1.2.3-55-g6feb