diff --git a/CommandDotNet.TestTools/AppRunnerTestConfigExtensions.cs b/CommandDotNet.TestTools/AppRunnerTestConfigExtensions.cs index 1dd1a1ce..d5815bcc 100644 --- a/CommandDotNet.TestTools/AppRunnerTestConfigExtensions.cs +++ b/CommandDotNet.TestTools/AppRunnerTestConfigExtensions.cs @@ -36,7 +36,7 @@ public static AppRunner InterceptSystemConsoleWrites(this AppRunner runner, Midd middlewareStep ?? new MiddlewareStep(MiddlewareStages.Invoke, short.MinValue))); } - private static Task InterceptingSystemConsoleWrites(CommandContext context, ExecutionDelegate next) + private static async Task InterceptingSystemConsoleWrites(CommandContext context, ExecutionDelegate next) { if (Console.Out is DuplexTextWriter) { @@ -49,7 +49,7 @@ private static Task InterceptingSystemConsoleWrites(CommandContext context, { Console.SetOut(@out); Console.SetError(error); - return next(context); + return await next(context); } finally { diff --git a/CommandDotNet/Localization/CultureDirective.cs b/CommandDotNet/Localization/CultureDirective.cs index 4466bb24..52cc77ab 100644 --- a/CommandDotNet/Localization/CultureDirective.cs +++ b/CommandDotNet/Localization/CultureDirective.cs @@ -14,7 +14,7 @@ internal static AppRunner UseCultureDirective(AppRunner appRunner) return appRunner.Configure(c => c.UseMiddleware(CheckCulture, MiddlewareSteps.DebugDirective + 1)); } - private static Task CheckCulture(CommandContext context, ExecutionDelegate next) + private static async Task CheckCulture(CommandContext context, ExecutionDelegate next) { Action? revert = null; @@ -36,7 +36,7 @@ private static Task CheckCulture(CommandContext context, ExecutionDelegate CultureInfo.CurrentUICulture = cultureInfo; } - var result = next(context); + var result = await next(context); // revert for tests and interactive repl sessions revert?.Invoke();