File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed
tests/ConsoleAppFramework.Tests/Integration Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,48 @@ public void NoOptions_NoArgs()
1818 console . Output . Should ( ) . Contain ( "HelloMyWorld" ) ;
1919 }
2020
21+ [ Fact ]
22+ public void IntArguments ( )
23+ {
24+ using var console = new CaptureConsoleOutput ( ) ;
25+
26+ var args = "--foo 1,2,3" . Split ( ' ' ) ;
27+
28+ ConsoleApp . RunAsync ( args , ( string [ ] foo ) =>
29+ {
30+ foreach ( var item in foo )
31+ {
32+ Console . WriteLine ( item ) ;
33+ }
34+ } ) ;
35+
36+ console . Output . Should ( ) . Be ( @"1
37+ 2
38+ 3
39+ " ) ;
40+ }
41+
42+ [ Fact ]
43+ public void StringArguments ( )
44+ {
45+ using var console = new CaptureConsoleOutput ( ) ;
46+
47+ var args = "--foo a,b,c" . Split ( ' ' ) ;
48+
49+ ConsoleApp . RunAsync ( args , ( string [ ] foo ) =>
50+ {
51+ foreach ( var item in foo )
52+ {
53+ Console . WriteLine ( item ) ;
54+ }
55+ } ) ;
56+
57+ console . Output . Should ( ) . Be ( @"a
58+ b
59+ c
60+ " ) ;
61+ }
62+
2163 public class CommandTests_Single_NoOptions_NoArgs : ConsoleAppBase
2264 {
2365 public void Hello ( ) => Console . WriteLine ( "HelloMyWorld" ) ;
You can’t perform that action at this time.
0 commit comments