@@ -30,28 +30,31 @@ public void Value_is_always_activated()
30
30
isActive . Should ( ) . BeTrue ( ) ;
31
31
}
32
32
33
- [ Fact ]
33
+ [ Fact ( Skip = "WIP" ) ]
34
34
public void ValueSubsystem_returns_values_that_are_entered ( )
35
35
{
36
+ var consoleHack = new ConsoleHack ( ) . RedirectToBuffer ( true ) ;
37
+ var pipeline = Pipeline . Create ( ) ;
38
+ CliOption < int > option1 = new CliOption < int > ( "--intValue" ) ;
36
39
CliRootCommand rootCommand = [
37
40
new CliCommand ( "x" )
38
41
{
39
- new CliOption < int > ( "--intValue" ) ,
40
- new CliOption < string > ( "--stringValue" ) ,
41
- new CliOption < bool > ( "--boolValue" )
42
+ option1
42
43
} ] ;
43
44
var configuration = new CliConfiguration ( rootCommand ) ;
44
- var subsystem = new ValueSubsystem ( ) ;
45
45
const int expected1 = 42 ;
46
- const string expected2 = "43" ;
47
- var input = $ "x --intValue { expected1 } --stringValue \" { expected2 } \" --boolValue";
48
- var args = CliParser . SplitCommandLine ( input ) . ToList ( ) ;
46
+ var input = $ "x --intValue { expected1 } ";
49
47
50
- Subsystem . Initialize ( subsystem , configuration , args ) ;
51
- var parseResult = CliParser . Parse ( rootCommand , input , configuration ) ;
48
+ pipeline . Parse ( configuration , input ) ;
49
+ pipeline . Execute ( configuration , input , consoleHack ) ;
50
+
51
+ pipeline . Value . GetValue < int > ( option1 ) . Should ( ) . Be ( expected1 ) ;
52
+ }
53
+
54
+
55
+ [ Fact ( Skip = "WIP" ) ]
56
+ public void ValueSubsystem_returns_default_value_when_no_value_is_entered ( )
57
+ {
52
58
53
- parseResult . GetValue < int > ( "--intValue" ) . Should ( ) . Be ( expected1 ) ;
54
- parseResult . GetValue < string > ( "--stringValue" ) . Should ( ) . Be ( expected2 ) ;
55
- parseResult . GetValue < bool > ( "--boolValue" ) . Should ( ) . Be ( true ) ;
56
59
}
57
60
}
0 commit comments