File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -6,9 +6,9 @@ namespace TfvcMigrator.Tests;
6
6
public static class ReadmeTests
7
7
{
8
8
[ 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 ( )
10
10
{
11
- var helpOutput = TestUtils . CaptureConsoleOutput ( ( ) => Program . Main ( new [ ] { "--help" } ) )
11
+ var helpOutput = ( await TestUtils . CaptureConsoleOutputAsync ( async ( ) => await Program . Main ( new [ ] { "--help" } ) ) )
12
12
. Replace ( Assembly . GetEntryAssembly ( ) ! . GetName ( ) . Name ! , typeof ( Program ) . Assembly . GetName ( ) . Name ) ;
13
13
14
14
var expectedReadmeCodeBlock = Regex . Replace ( helpOutput , @"\ADescription:\s*\n[^\n]*\n\s*\n" , "" ) ;
Original file line number Diff line number Diff line change 2
2
3
3
internal static class TestUtils
4
4
{
5
- public static string CaptureConsoleOutput ( Action action )
5
+ public static async Task < string > CaptureConsoleOutputAsync ( Func < Task > asyncAction )
6
6
{
7
7
var writer = new StringWriter ( ) ;
8
8
9
9
var originalConsoleOut = Console . Out ;
10
10
Console . SetOut ( writer ) ;
11
11
try
12
12
{
13
- action . Invoke ( ) ;
13
+ await asyncAction . Invoke ( ) ;
14
14
}
15
15
finally
16
16
{
You can’t perform that action at this time.
0 commit comments