public static FluentAssertions.AndConstraint <CommandResultAssertions> ExecuteComponentEntryPointWithException(this CommandResultAssertions assertion, string methodName, int componentCallCount)
        {
            var constraint = assertion.ExecuteComponentEntryPoint(methodName, componentCallCount);

            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                return(constraint.And.HaveStdOutContaining($"{methodName} delegate threw exception: 0x{Constants.ErrorCode.COMPlusException.ToString("x")}"));
            }
            else
            {
                // Exception is unhandled by native host on non-Windows systems
                return(constraint.And.ExitWith(Constants.ErrorCode.SIGABRT)
                       .And.HaveStdErrContaining($"Unhandled exception. System.InvalidOperationException: {methodName}"));
            }
        }
 public static FluentAssertions.AndConstraint <CommandResultAssertions> ExecuteComponentEntryPoint(this CommandResultAssertions assertion, string methodName, int componentCallCount, int returnValue)
 {
     return(assertion.ExecuteComponentEntryPoint(methodName, componentCallCount)
            .And.HaveStdOutContaining($"{methodName} delegate result: 0x{returnValue.ToString("x")}"));
 }