@@ -148,6 +148,9 @@ public void Configure_AppliesTimeout()
148148 [ InlineData ( "fixedDelay" , "3" , null , true ) ]
149149 [ InlineData ( "fixedDelay" , "3" , "-10000000000" , true ) ]
150150 [ 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 ) ]
151154 public void Configure_AppliesRetry_FixedDelay ( string expectedStrategy , string maxRetryCount , string delayInterval , bool throwsError )
152155 {
153156 var settings = new Dictionary < string , string >
@@ -156,19 +159,24 @@ public void Configure_AppliesRetry_FixedDelay(string expectedStrategy, string ma
156159 { ConfigurationPath . Combine ( ConfigurationSectionNames . JobHost , "retry" , "maxRetryCount" ) , maxRetryCount } ,
157160 { ConfigurationPath . Combine ( ConfigurationSectionNames . JobHost , "retry" , "delayInterval" ) , delayInterval }
158161 } ;
159- if ( string . IsNullOrEmpty ( delayInterval ) )
162+ if ( string . IsNullOrEmpty ( delayInterval ) || string . IsNullOrEmpty ( maxRetryCount ) )
160163 {
161- Assert . Throws < ArgumentOutOfRangeException > ( ( ) => GetConfiguredOptions ( settings ) ) ;
164+ Assert . Throws < ArgumentNullException > ( ( ) => GetConfiguredOptions ( settings ) ) ;
162165 return ;
163166 }
164167 if ( throwsError )
165168 {
169+ if ( int . Parse ( maxRetryCount ) <= 0 )
170+ {
171+ Assert . Throws < ArgumentOutOfRangeException > ( ( ) => GetConfiguredOptions ( settings ) ) ;
172+ return ;
173+ }
166174 Assert . Throws < InvalidOperationException > ( ( ) => GetConfiguredOptions ( settings ) ) ;
167175 return ;
168176 }
169177 var options = GetConfiguredOptions ( settings ) ;
170178 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 ) ;
172180 Assert . Equal ( TimeSpan . Parse ( delayInterval ) , options . Retry . DelayInterval ) ;
173181 }
174182
@@ -189,7 +197,7 @@ public void Configure_AppliesRetry_ExponentialBackOffDelay(string expectedStrate
189197 } ;
190198 if ( string . IsNullOrEmpty ( minimumInterval ) || string . IsNullOrEmpty ( maximumInterval ) )
191199 {
192- Assert . Throws < ArgumentOutOfRangeException > ( ( ) => GetConfiguredOptions ( settings ) ) ;
200+ Assert . Throws < ArgumentNullException > ( ( ) => GetConfiguredOptions ( settings ) ) ;
193201 return ;
194202 }
195203 var minIntervalTimeSpan = TimeSpan . Parse ( minimumInterval ) ;
0 commit comments