@@ -148,6 +148,9 @@ public void Configure_AppliesTimeout()
148
148
[ InlineData ( "fixedDelay" , "3" , null , true ) ]
149
149
[ InlineData ( "fixedDelay" , "3" , "-10000000000" , true ) ]
150
150
[ InlineData ( "fixedDelay" , "3" , "10000000000:00000000:40000" , true ) ]
151
+ [ InlineData ( "fixedDelay" , null , "00:00:05" , true ) ]
152
+ [ InlineData ( "fixedDelay" , "-1" , "00:00:05" , false ) ]
153
+ [ InlineData ( "fixedDelay" , "-4" , "00:00:05" , true ) ]
151
154
public void Configure_AppliesRetry_FixedDelay ( string expectedStrategy , string maxRetryCount , string delayInterval , bool throwsError )
152
155
{
153
156
var settings = new Dictionary < string , string >
@@ -156,19 +159,24 @@ public void Configure_AppliesRetry_FixedDelay(string expectedStrategy, string ma
156
159
{ ConfigurationPath . Combine ( ConfigurationSectionNames . JobHost , "retry" , "maxRetryCount" ) , maxRetryCount } ,
157
160
{ ConfigurationPath . Combine ( ConfigurationSectionNames . JobHost , "retry" , "delayInterval" ) , delayInterval }
158
161
} ;
159
- if ( string . IsNullOrEmpty ( delayInterval ) )
162
+ if ( string . IsNullOrEmpty ( delayInterval ) || string . IsNullOrEmpty ( maxRetryCount ) )
160
163
{
161
- Assert . Throws < ArgumentOutOfRangeException > ( ( ) => GetConfiguredOptions ( settings ) ) ;
164
+ Assert . Throws < ArgumentNullException > ( ( ) => GetConfiguredOptions ( settings ) ) ;
162
165
return ;
163
166
}
164
167
if ( throwsError )
165
168
{
169
+ if ( int . Parse ( maxRetryCount ) <= 0 )
170
+ {
171
+ Assert . Throws < ArgumentOutOfRangeException > ( ( ) => GetConfiguredOptions ( settings ) ) ;
172
+ return ;
173
+ }
166
174
Assert . Throws < InvalidOperationException > ( ( ) => GetConfiguredOptions ( settings ) ) ;
167
175
return ;
168
176
}
169
177
var options = GetConfiguredOptions ( settings ) ;
170
178
Assert . Equal ( RetryStrategy . FixedDelay , options . Retry . Strategy ) ;
171
- Assert . Equal ( int . Parse ( maxRetryCount ) , options . Retry . MaxRetryCount ) ;
179
+ Assert . Equal ( int . Parse ( maxRetryCount ) , options . Retry . MaxRetryCount . Value ) ;
172
180
Assert . Equal ( TimeSpan . Parse ( delayInterval ) , options . Retry . DelayInterval ) ;
173
181
}
174
182
@@ -189,7 +197,7 @@ public void Configure_AppliesRetry_ExponentialBackOffDelay(string expectedStrate
189
197
} ;
190
198
if ( string . IsNullOrEmpty ( minimumInterval ) || string . IsNullOrEmpty ( maximumInterval ) )
191
199
{
192
- Assert . Throws < ArgumentOutOfRangeException > ( ( ) => GetConfiguredOptions ( settings ) ) ;
200
+ Assert . Throws < ArgumentNullException > ( ( ) => GetConfiguredOptions ( settings ) ) ;
193
201
return ;
194
202
}
195
203
var minIntervalTimeSpan = TimeSpan . Parse ( minimumInterval ) ;
0 commit comments