@@ -116,7 +116,7 @@ public async Task HttpTest_Headers()
116116 req . Headers . Add ( "header3" , "value3" ) ;
117117 var result = await SendAsync ( req ) . ReceiveString ( ) ;
118118 var json = JsonDocument . Parse ( result ) ;
119- var headers = json . RootElement . GetProperty ( "headers" ) . Deserialize < Dictionary < string , string > > ( ) . Select ( kv => kv . Key ) . ToList ( ) ;
119+ var headers = json . RootElement . GetProperty ( "headers" ) . GetDictionary ( ) . Select ( kv => kv . Key ) . ToList ( ) ;
120120 Assert . Contains ( "header1" , headers ) ;
121121 Assert . Contains ( "header2" , headers ) ;
122122 Assert . Contains ( "header3" , headers ) ;
@@ -135,7 +135,7 @@ public async Task HttpTest_HeadersOrder()
135135 req . SetHeadersOrder ( "header3" , "header2" , "header1" ) ;
136136 var result = await SendAsync ( req ) . ReceiveString ( ) ;
137137 var json = JsonDocument . Parse ( result ) ;
138- var headers = json . RootElement . GetProperty ( "headers" ) . Deserialize < Dictionary < string , string > > ( ) . Select ( kv => kv . Key ) . ToList ( ) ;
138+ var headers = json . RootElement . GetProperty ( "headers" ) . GetDictionary ( ) . Select ( kv => kv . Key ) . ToList ( ) ;
139139 var index1 = headers . IndexOf ( "header1" ) ;
140140 var index2 = headers . IndexOf ( "header2" ) ;
141141 var index3 = headers . IndexOf ( "header3" ) ;
@@ -220,7 +220,7 @@ public async Task HttpTest_SetCookie()
220220 const string page = @"https://httpbingo.org/cookies/set?k1=v1" ;
221221 var result = await GetAsync ( page ) . ReceiveString ( ) ;
222222 var json = JsonDocument . Parse ( result ) ;
223- var cookies = json . RootElement . Deserialize < Dictionary < string , string > > ( ) ;
223+ var cookies = json . RootElement . GetDictionary ( ) ;
224224 Assert . Contains ( new KeyValuePair < string , string > ( "k1" , "v1" ) , cookies ) ;
225225 }
226226
@@ -232,7 +232,7 @@ public async Task HttpTest_SetCookieAgain()
232232 const string page2 = @"https://httpbingo.org/cookies/set?k1=v2" ;
233233 var result = await GetAsync ( page2 ) . ReceiveString ( ) ;
234234 var json = JsonDocument . Parse ( result ) ;
235- var cookies = json . RootElement . Deserialize < Dictionary < string , string > > ( ) ;
235+ var cookies = json . RootElement . GetDictionary ( ) ;
236236 Assert . Contains ( new KeyValuePair < string , string > ( "k1" , "v2" ) , cookies ) ;
237237 }
238238
@@ -248,7 +248,7 @@ public async Task HttpTest_SetCookies()
248248 const string page2 = @"https://httpbingo.org/cookies" ;
249249 var result = await GetAsync ( page2 ) . ReceiveString ( ) ;
250250 var json = JsonDocument . Parse ( result ) ;
251- var cookies = json . RootElement . Deserialize < Dictionary < string , string > > ( ) ;
251+ var cookies = json . RootElement . GetDictionary ( ) ;
252252 Assert . Contains ( new KeyValuePair < string , string > ( "k1" , "v1" ) , cookies ) ;
253253 Assert . Contains ( new KeyValuePair < string , string > ( "k2" , "v2" ) , cookies ) ;
254254 }
@@ -263,7 +263,7 @@ public async Task HttpTest_DeleteCookie()
263263 const string page2 = @"https://httpbingo.org/cookies/delete?k1" ;
264264 var result = await GetAsync ( page2 ) . ReceiveString ( ) ;
265265 var json = JsonDocument . Parse ( result ) ;
266- var cookies = json . RootElement . Deserialize < Dictionary < string , string > > ( ) ;
266+ var cookies = json . RootElement . GetDictionary ( ) ;
267267 Assert . DoesNotContain ( new KeyValuePair < string , string > ( "k1" , "v1" ) , cookies ) ;
268268 }
269269
@@ -274,7 +274,7 @@ public async Task HttpTest_DoNotUseCookies()
274274 DisableCookies ( ) ;
275275 var result = await GetAsync ( page ) . ReceiveString ( ) ;
276276 var json = JsonDocument . Parse ( result ) ;
277- var cookies = json . RootElement . Deserialize < Dictionary < string , string > > ( ) ;
277+ var cookies = json . RootElement . GetDictionary ( ) ;
278278 Assert . Empty ( cookies ) ;
279279 }
280280
0 commit comments