File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
src/System.CommandLine.Tests Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ // Copyright (c) .NET Foundation and contributors. All rights reserved.
2+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3+
4+ using System . CommandLine . IO ;
5+ using FluentAssertions ;
6+ using Xunit ;
7+
8+ namespace System . CommandLine . Tests
9+ {
10+ public class CommandExtensionsTests
11+ {
12+ [ Fact ]
13+ public void Mulitple_invocations_via_Invoke_extension_will_not_reconfigure_implicit_parser ( )
14+ {
15+ var command = new RootCommand ( "Root command description" )
16+ {
17+ new Command ( "inner" )
18+ } ;
19+
20+ var console1 = new TestConsole ( ) ;
21+
22+ command . Invoke ( "-h" , console1 ) ;
23+
24+ console1 . Out . ToString ( ) . Should ( ) . Contain ( command . Description ) ;
25+
26+ var console2 = new TestConsole ( ) ;
27+
28+ command . Invoke ( "-h" , console2 ) ;
29+
30+ console2 . Out . ToString ( ) . Should ( ) . Contain ( command . Description ) ;
31+ }
32+ }
33+ }
You can’t perform that action at this time.
0 commit comments