This repository was archived by the owner on Jul 9, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-15
lines changed
Microsoft.Kiota.Http.HttpClientLibrary.Tests Expand file tree Collapse file tree 1 file changed +4
-15
lines changed Original file line number Diff line number Diff line change 1
- using System . Collections ;
2
- using System . Collections . Generic ;
1
+ using System . Collections . Generic ;
3
2
using System . Linq ;
4
3
using System . Net ;
5
4
using System . Net . Http ;
6
- using Castle . Components . DictionaryAdapter . Xml ;
7
5
using Microsoft . Kiota . Http . HttpClientLibrary . Middleware ;
8
6
using Microsoft . Kiota . Http . HttpClientLibrary . Middleware . Options ;
9
7
using Microsoft . Kiota . Http . HttpClientLibrary . Tests . Mocks ;
@@ -112,21 +110,12 @@ public void CreateDefaultHandlersWithOptions()
112
110
113
111
114
112
// Act
115
- var handlers = KiotaClientFactory . CreateDefaultHandlers ( new [ ] { retryHandlerOption } ) ;
116
-
117
- RetryHandler retryHandler = default ;
118
- foreach ( var handler in handlers )
119
- {
120
- if ( handler is RetryHandler retryFromDefault )
121
- {
122
- retryHandler = retryFromDefault ;
123
- break ;
124
- }
125
- }
113
+ var handlers = KiotaClientFactory . CreateDefaultHandlers ( [ retryHandlerOption ] ) ;
114
+ var retryHandler = handlers . OfType < RetryHandler > ( ) . FirstOrDefault ( ) ;
126
115
127
116
// Assert
128
117
Assert . NotNull ( retryHandler ) ;
129
- Assert . NotNull ( retryHandler . RetryOption ) ;
118
+ Assert . Equal ( retryHandlerOption , retryHandler . RetryOption ) ;
130
119
}
131
120
132
121
[ Fact ]
You can’t perform that action at this time.
0 commit comments