@@ -34,61 +34,61 @@ public void Value_is_always_activated()
34
34
public void ValueSubsystem_returns_values_that_are_entered ( )
35
35
{
36
36
var consoleHack = new ConsoleHack ( ) . RedirectToBuffer ( true ) ;
37
- CliOption < int > option1 = new CliOption < int > ( "--intValue" ) ;
37
+ CliOption < int > option = new CliOption < int > ( "--intValue" ) ;
38
38
CliRootCommand rootCommand = [
39
39
new CliCommand ( "x" )
40
40
{
41
- option1
41
+ option
42
42
} ] ;
43
43
var configuration = new CliConfiguration ( rootCommand ) ;
44
44
var pipeline = Pipeline . CreateEmpty ( ) ;
45
45
pipeline . Value = new ValueSubsystem ( ) ;
46
- const int expected1 = 42 ;
47
- var input = $ "x --intValue { expected1 } ";
46
+ const int expected = 42 ;
47
+ var input = $ "x --intValue { expected } ";
48
48
49
49
var parseResult = pipeline . Parse ( configuration , input ) ; // assigned for debugging
50
50
pipeline . Execute ( configuration , input , consoleHack ) ;
51
51
52
- pipeline . Value . GetValue < int > ( option1 ) . Should ( ) . Be ( expected1 ) ;
52
+ pipeline . Value . GetValue < int > ( option ) . Should ( ) . Be ( expected ) ;
53
53
}
54
54
55
55
[ Fact ]
56
56
public void ValueSubsystem_returns_default_value_when_no_value_is_entered ( )
57
57
{
58
58
var consoleHack = new ConsoleHack ( ) . RedirectToBuffer ( true ) ;
59
- CliOption < int > option1 = new CliOption < int > ( "--intValue" ) ;
60
- CliRootCommand rootCommand = [ option1 ] ;
59
+ CliOption < int > option = new CliOption < int > ( "--intValue" ) ;
60
+ CliRootCommand rootCommand = [ option ] ;
61
61
var configuration = new CliConfiguration ( rootCommand ) ;
62
62
var pipeline = Pipeline . CreateEmpty ( ) ;
63
63
pipeline . Value = new ValueSubsystem ( ) ;
64
- pipeline . Value . DefaultValue . Set ( option1 , 43 ) ;
65
- const int expected1 = 43 ;
64
+ pipeline . Value . DefaultValue . Set ( option , 43 ) ;
65
+ const int expected = 43 ;
66
66
var input = $ "" ;
67
67
68
68
var parseResult = pipeline . Parse ( configuration , input ) ; // assigned for debugging
69
69
pipeline . Execute ( configuration , input , consoleHack ) ;
70
70
71
- pipeline . Value . GetValue < int > ( option1 ) . Should ( ) . Be ( expected1 ) ;
71
+ pipeline . Value . GetValue < int > ( option ) . Should ( ) . Be ( expected ) ;
72
72
}
73
73
74
74
75
75
[ Fact ]
76
76
public void ValueSubsystem_returns_calculated_default_value_when_no_value_is_entered ( )
77
77
{
78
78
var consoleHack = new ConsoleHack ( ) . RedirectToBuffer ( true ) ;
79
- CliOption < int > option1 = new CliOption < int > ( "--intValue" ) ;
80
- CliRootCommand rootCommand = [ option1 ] ;
79
+ CliOption < int > option = new CliOption < int > ( "--intValue" ) ;
80
+ CliRootCommand rootCommand = [ option ] ;
81
81
var configuration = new CliConfiguration ( rootCommand ) ;
82
82
var pipeline = Pipeline . CreateEmpty ( ) ;
83
83
pipeline . Value = new ValueSubsystem ( ) ;
84
84
var x = 42 ;
85
- pipeline . Value . DefaultValueCalculation . Set ( option1 , ( ) => x + 2 ) ;
86
- const int expected1 = 44 ;
85
+ pipeline . Value . DefaultValueCalculation . Set ( option , ( ) => x + 2 ) ;
86
+ const int expected = 44 ;
87
87
var input = $ "" ;
88
88
89
89
var parseResult = pipeline . Parse ( configuration , input ) ; // assigned for debugging
90
90
pipeline . Execute ( configuration , input , consoleHack ) ;
91
91
92
- pipeline . Value . GetValue < int > ( option1 ) . Should ( ) . Be ( expected1 ) ;
92
+ pipeline . Value . GetValue < int > ( option ) . Should ( ) . Be ( expected ) ;
93
93
}
94
94
}
0 commit comments