@@ -22,7 +22,7 @@ private CliOption GetOptionWithSimpleRange<T>(T lowerBound, T upperBound)
22
22
return option ;
23
23
}
24
24
25
- private CliOption GetOptionWithRangeBounds < T > ( RangeBound < T > lowerBound , RangeBound < T > upperBound )
25
+ private CliOption GetOptionWithRangeBounds < T > ( ValueSource < T > lowerBound , ValueSource < T > upperBound )
26
26
where T : IComparable < T >
27
27
{
28
28
var option = new CliOption < int > ( "--intOpt" ) ;
@@ -107,7 +107,7 @@ public void Int_values_on_upper_range_bound_do_not_report_error()
107
107
[ Fact ]
108
108
public void Values_below_calculated_lower_bound_report_error ( )
109
109
{
110
- var option = GetOptionWithRangeBounds ( RangeBound < int > . Create ( ( ) => 1 ) , 50 ) ;
110
+ var option = GetOptionWithRangeBounds ( ValueSource < int > . Create ( ( ) => 1 ) , 50 ) ;
111
111
112
112
var pipelineResult = ExecutedPipelineResultForRangeOption ( option , "--intOpt 0" ) ;
113
113
@@ -121,7 +121,7 @@ public void Values_below_calculated_lower_bound_report_error()
121
121
[ Fact ]
122
122
public void Values_within_calculated_range_do_not_report_error ( )
123
123
{
124
- var option = GetOptionWithRangeBounds ( RangeBound < int > . Create ( ( ) => 1 ) , RangeBound < int > . Create ( ( ) => 50 ) ) ;
124
+ var option = GetOptionWithRangeBounds ( ValueSource < int > . Create ( ( ) => 1 ) , ValueSource < int > . Create ( ( ) => 50 ) ) ;
125
125
126
126
var pipelineResult = ExecutedPipelineResultForRangeOption ( option , "--intOpt 42" ) ;
127
127
@@ -132,7 +132,7 @@ public void Values_within_calculated_range_do_not_report_error()
132
132
[ Fact ]
133
133
public void Values_above_calculated_upper_bound_report_error ( )
134
134
{
135
- var option = GetOptionWithRangeBounds ( 0 , RangeBound < int > . Create ( ( ) => 40 ) ) ;
135
+ var option = GetOptionWithRangeBounds ( 0 , ValueSource < int > . Create ( ( ) => 40 ) ) ;
136
136
137
137
var pipelineResult = ExecutedPipelineResultForRangeOption ( option , "--intOpt 42" ) ;
138
138
@@ -146,7 +146,7 @@ public void Values_above_calculated_upper_bound_report_error()
146
146
public void Values_below_relative_lower_bound_report_error ( )
147
147
{
148
148
var otherOption = new CliOption < int > ( "-a" ) ;
149
- var option = GetOptionWithRangeBounds ( RangeBound < int > . Create ( otherOption , o => ( int ) o + 1 ) , 50 ) ;
149
+ var option = GetOptionWithRangeBounds ( ValueSource < int > . Create ( otherOption , o => ( int ) o + 1 ) , 50 ) ;
150
150
var command = new CliCommand ( "cmd" ) { option , otherOption } ;
151
151
152
152
var pipelineResult = ExecutedPipelineResultForCommand ( command , "--intOpt 0 -a 0" ) ;
@@ -162,7 +162,7 @@ public void Values_below_relative_lower_bound_report_error()
162
162
public void Values_within_relative_range_do_not_report_error ( )
163
163
{
164
164
var otherOption = new CliOption < int > ( "-a" ) ;
165
- var option = GetOptionWithRangeBounds ( RangeBound < int > . Create ( otherOption , o => ( int ) o + 1 ) , RangeBound < int > . Create ( otherOption , o => ( int ) o + 10 ) ) ;
165
+ var option = GetOptionWithRangeBounds ( ValueSource < int > . Create ( otherOption , o => ( int ) o + 1 ) , ValueSource < int > . Create ( otherOption , o => ( int ) o + 10 ) ) ;
166
166
var command = new CliCommand ( "cmd" ) { option , otherOption } ;
167
167
168
168
var pipelineResult = ExecutedPipelineResultForCommand ( command , "--intOpt 11 -a 3" ) ;
@@ -175,7 +175,7 @@ public void Values_within_relative_range_do_not_report_error()
175
175
public void Values_above_relative_upper_bound_report_error ( )
176
176
{
177
177
var otherOption = new CliOption < int > ( "-a" ) ;
178
- var option = GetOptionWithRangeBounds ( 0 , RangeBound < int > . Create ( otherOption , o => ( int ) o + 10 ) ) ;
178
+ var option = GetOptionWithRangeBounds ( 0 , ValueSource < int > . Create ( otherOption , o => ( int ) o + 10 ) ) ;
179
179
var command = new CliCommand ( "cmd" ) { option , otherOption } ;
180
180
181
181
var pipelineResult = ExecutedPipelineResultForCommand ( command , "--intOpt 9 -a -2" ) ;
@@ -191,7 +191,7 @@ public void Values_below_environment_lower_bound_report_error()
191
191
{
192
192
var envName = "SYSTEM_COMMANDLINE_LOWERBOUND" ;
193
193
Environment . SetEnvironmentVariable ( envName , "2" ) ;
194
- var option = GetOptionWithRangeBounds ( RangeBound < int > . Create ( envName , s => int . Parse ( s ) + 1 ) , 50 ) ;
194
+ var option = GetOptionWithRangeBounds ( ValueSource < int > . Create ( envName , s => int . Parse ( s ) + 1 ) , 50 ) ;
195
195
196
196
var pipelineResult = ExecutedPipelineResultForRangeOption ( option , "--intOpt 2" ) ;
197
197
Environment . SetEnvironmentVariable ( envName , null ) ;
@@ -208,7 +208,7 @@ public void Values_within_environment_range_do_not_report_error()
208
208
{
209
209
var envName = "SYSTEM_COMMANDLINE_LOWERBOUND" ;
210
210
Environment . SetEnvironmentVariable ( envName , "2" ) ;
211
- var option = GetOptionWithRangeBounds ( RangeBound < int > . Create ( envName , s => int . Parse ( s ) + 1 ) , 50 ) ;
211
+ var option = GetOptionWithRangeBounds ( ValueSource < int > . Create ( envName , s => int . Parse ( s ) + 1 ) , 50 ) ;
212
212
213
213
var pipelineResult = ExecutedPipelineResultForRangeOption ( option , "--intOpt 11" ) ;
214
214
Environment . SetEnvironmentVariable ( envName , null ) ;
@@ -222,7 +222,7 @@ public void Values_above_environment_upper_bound_report_error()
222
222
{
223
223
var envName = "SYSTEM_COMMANDLINE_LOWERBOUND" ;
224
224
Environment . SetEnvironmentVariable ( envName , "2" ) ;
225
- var option = GetOptionWithRangeBounds ( 0 , RangeBound < int > . Create ( envName , s => int . Parse ( s ) + 1 ) ) ;
225
+ var option = GetOptionWithRangeBounds ( 0 , ValueSource < int > . Create ( envName , s => int . Parse ( s ) + 1 ) ) ;
226
226
227
227
var pipelineResult = ExecutedPipelineResultForRangeOption ( option , "--intOpt 4" ) ;
228
228
Environment . SetEnvironmentVariable ( envName , null ) ;
0 commit comments