Skip to content

Commit 0e4b187

Browse files
committed
Program.Main should be awaited
1 parent 74fb4c5 commit 0e4b187

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/TfvcMigrator.Tests/ReadmeTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ namespace TfvcMigrator.Tests;
66
public static class ReadmeTests
77
{
88
[Test]
9-
public static void Command_line_arguments_section_is_up_to_date()
9+
public static async Task Command_line_arguments_section_is_up_to_date()
1010
{
11-
var helpOutput = TestUtils.CaptureConsoleOutput(() => Program.Main(new[] { "--help" }))
11+
var helpOutput = (await TestUtils.CaptureConsoleOutputAsync(async () => await Program.Main(new[] { "--help" })))
1212
.Replace(Assembly.GetEntryAssembly()!.GetName().Name!, typeof(Program).Assembly.GetName().Name);
1313

1414
var expectedReadmeCodeBlock = Regex.Replace(helpOutput, @"\ADescription:\s*\n[^\n]*\n\s*\n", "");

src/TfvcMigrator.Tests/TestUtils.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
internal static class TestUtils
44
{
5-
public static string CaptureConsoleOutput(Action action)
5+
public static async Task<string> CaptureConsoleOutputAsync(Func<Task> asyncAction)
66
{
77
var writer = new StringWriter();
88

99
var originalConsoleOut = Console.Out;
1010
Console.SetOut(writer);
1111
try
1212
{
13-
action.Invoke();
13+
await asyncAction.Invoke();
1414
}
1515
finally
1616
{

0 commit comments

Comments
 (0)