From 42b570e34f9cfadbf6f6135cd6b55630c13538be Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Tue, 23 Mar 2021 15:54:20 -0700 Subject: Throw WixException for internal errors and Messaging for user errors --- .../WixToolsetTest.CoreIntegration/CustomActionFixture.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/test/WixToolsetTest.CoreIntegration') diff --git a/src/test/WixToolsetTest.CoreIntegration/CustomActionFixture.cs b/src/test/WixToolsetTest.CoreIntegration/CustomActionFixture.cs index 7980ea61..636b86a6 100644 --- a/src/test/WixToolsetTest.CoreIntegration/CustomActionFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/CustomActionFixture.cs @@ -6,7 +6,6 @@ namespace WixToolsetTest.CoreIntegration using System.Linq; using WixBuildTools.TestSupport; using WixToolset.Core.TestPackage; - using WixToolset.Data; using Xunit; public class CustomActionFixture @@ -22,7 +21,7 @@ namespace WixToolsetTest.CoreIntegration var intermediateFolder = Path.Combine(baseFolder, "obj"); var msiPath = Path.Combine(baseFolder, @"bin\test.msi"); - var exception = Assert.Throws(() => WixRunner.Execute(new[] + var result = WixRunner.Execute(new[] { "build", Path.Combine(folder, "CustomAction", "CustomActionCycle.wxs"), @@ -31,9 +30,10 @@ namespace WixToolsetTest.CoreIntegration "-bindpath", Path.Combine(folder, "SingleFile", "data"), "-intermediateFolder", intermediateFolder, "-o", msiPath - })); + }); - Assert.Equal("The InstallExecuteSequence table contains an action 'Action1' that is scheduled to come before or after action 'Action3', which is also scheduled to come before or after action 'Action1'. Please remove this circular dependency by changing the Before or After attribute for one of the actions.", exception.Message); + Assert.Equal(176, result.ExitCode); + Assert.Equal("The InstallExecuteSequence table contains an action 'Action1' that is scheduled to come before or after action 'Action3', which is also scheduled to come before or after action 'Action1'. Please remove this circular dependency by changing the Before or After attribute for one of the actions.", result.Messages[0].ToString()); } } @@ -48,7 +48,7 @@ namespace WixToolsetTest.CoreIntegration var intermediateFolder = Path.Combine(baseFolder, "obj"); var msiPath = Path.Combine(baseFolder, @"bin\test.msi"); - var exception = Assert.Throws(() => WixRunner.Execute(new[] + var result = WixRunner.Execute(new[] { "build", Path.Combine(folder, "CustomAction", "CustomActionCycleWithTail.wxs"), @@ -57,9 +57,10 @@ namespace WixToolsetTest.CoreIntegration "-bindpath", Path.Combine(folder, "SingleFile", "data"), "-intermediateFolder", intermediateFolder, "-o", msiPath - })); + }); - Assert.Equal("The InstallExecuteSequence table contains an action 'Action2' that is scheduled to come before or after action 'Action4', which is also scheduled to come before or after action 'Action2'. Please remove this circular dependency by changing the Before or After attribute for one of the actions.", exception.Message); + Assert.Equal(176, result.ExitCode); + Assert.Equal("The InstallExecuteSequence table contains an action 'Action2' that is scheduled to come before or after action 'Action4', which is also scheduled to come before or after action 'Action2'. Please remove this circular dependency by changing the Before or After attribute for one of the actions.", result.Messages[0].ToString()); } } -- cgit v1.2.3-55-g6feb