4
4
using System . Net ;
5
5
using System . Net . Http ;
6
6
using System . Net . Http . Headers ;
7
+ using System . Text . Json ;
7
8
using System . Threading . Tasks ;
8
9
using GitCredentialManager ;
9
10
using GitCredentialManager . Tests . Objects ;
10
- using Newtonsoft . Json ;
11
11
using Xunit ;
12
12
13
13
namespace Microsoft . AzureRepos . Tests
@@ -411,9 +411,10 @@ private static void AssertBearerToken(HttpRequestMessage request, string bearerT
411
411
412
412
private static HttpResponseMessage CreateLocationServiceResponse ( Uri identityServiceUri )
413
413
{
414
- var json = JsonConvert . SerializeObject (
415
- new Dictionary < string , object > { [ "location" ] = identityServiceUri . AbsoluteUri }
416
- ) ;
414
+ var json = JsonSerializer . Serialize ( new Dictionary < string , object >
415
+ {
416
+ [ "location" ] = identityServiceUri . AbsoluteUri
417
+ } ) ;
417
418
418
419
return new HttpResponseMessage ( HttpStatusCode . OK )
419
420
{
@@ -423,7 +424,7 @@ private static HttpResponseMessage CreateLocationServiceResponse(Uri identitySer
423
424
424
425
private static HttpResponseMessage CreateIdentityServiceResponse ( string pat )
425
426
{
426
- var json = JsonConvert . SerializeObject (
427
+ var json = JsonSerializer . Serialize (
427
428
new Dictionary < string , object > { [ "token" ] = pat }
428
429
) ;
429
430
@@ -435,7 +436,7 @@ private static HttpResponseMessage CreateIdentityServiceResponse(string pat)
435
436
436
437
private static HttpResponseMessage CreateIdentityServiceErrorResponse ( string errorMessage )
437
438
{
438
- var json = JsonConvert . SerializeObject (
439
+ var json = JsonSerializer . Serialize (
439
440
new Dictionary < string , object > { [ "message" ] = errorMessage }
440
441
) ;
441
442
0 commit comments