@@ -391,10 +391,10 @@ public void TestValidJsonPagingResponseNoParameters()
391391 return "{\" stat\" : \" OK\" , \" response\" : \" hello, world!\" , \" metadata\" : {\" next_offset\" :10}}" ;
392392 } ;
393393 var parameters = new Dictionary < string , string > ( ) ;
394- var jsonResponse = api . JSONPagingApiCall ( "GET" , "/json_ok" , parameters , 0 , 10 ) ;
395- Assert . Equal ( "hello, world!" , jsonResponse [ "response" ] ) ;
396- var metadata = jsonResponse [ "metadata" ] as Dictionary < string , object > ;
397- Assert . Equal ( 10 , metadata [ " next_offset" ] ) ;
394+ var jsonResponse = api . JSONPagingApiCall < string > ( "GET" , "/json_ok" , parameters , 0 , 10 , out var metadata ) ;
395+ Assert . Equal ( "hello, world!" , jsonResponse ) ;
396+
397+ Assert . Equal ( 10 , metadata . next_offset ) ;
398398 // make sure parameters was not changed as a side-effect
399399 Assert . Empty ( parameters ) ;
400400 }
@@ -411,10 +411,10 @@ public void TestValidJsonPagingResponseExistingParameters()
411411 { "offset" , "0" } ,
412412 { "limit" , "10" }
413413 } ;
414- var jsonResponse = api . JSONPagingApiCall ( "GET" , "/json_ok" , parameters , 10 , 20 ) ;
415- Assert . Equal ( "hello, world!" , jsonResponse [ "response" ] ) ;
416- var metadata = jsonResponse [ "metadata" ] as Dictionary < string , object > ;
417- Assert . False ( metadata . ContainsKey ( "next_offset" ) ) ;
414+ var jsonResponse = api . JSONPagingApiCall < string > ( "GET" , "/json_ok" , parameters , 10 , 20 , out var metadata ) ;
415+ Assert . Equal ( "hello, world!" , jsonResponse ) ;
416+
417+ Assert . NotNull ( metadata ) ;
418418 // make sure parameters was not changed as a side-effect
419419 Assert . Equal ( 2 , parameters . Count ) ;
420420 Assert . Equal ( "0" , parameters [ "offset" ] ) ;
@@ -461,7 +461,7 @@ public void TestJsonResponseMissingField()
461461 } ) ;
462462
463463 Assert . NotNull ( ex ) ;
464- var e = Assert . IsType < BadResponseException > ( ex ) ;
464+ var e = Assert . IsType < ApiException > ( ex ) ;
465465
466466 Assert . Equal ( 400 , e . HttpStatus ) ;
467467
0 commit comments