11// Copyright (c) .NET Foundation. All rights reserved.
22// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33
4- #nullable disable
5-
64using Newtonsoft . Json ;
75using Xunit ;
86
97namespace NuGet . Credentials . Test
108{
119 public class PluginCredentialResponseDeserializationTests
1210 {
13- private static PluginCredentialResponse DeserializeWithStj ( string json )
11+ private static PluginCredentialResponse ? DeserializeWithStj ( string json )
1412 {
1513 return System . Text . Json . JsonSerializer . Deserialize ( json , PluginCredentialResponseJsonContext . Default . PluginCredentialResponse ) ;
1614 }
1715
18- private static PluginCredentialResponse DeserializeWithNsj ( string json )
16+ private static PluginCredentialResponse ? DeserializeWithNsj ( string json )
1917 {
2018 return JsonConvert . DeserializeObject < PluginCredentialResponse > ( json ) ;
2119 }
2220
23- private static void AssertResponsesEqual ( PluginCredentialResponse nsj , PluginCredentialResponse stj )
21+ private static void AssertResponsesEqual ( PluginCredentialResponse ? nsj , PluginCredentialResponse ? stj )
2422 {
2523 Assert . Equal ( nsj ? . Username , stj ? . Username ) ;
2624 Assert . Equal ( nsj ? . Password , stj ? . Password ) ;
@@ -49,8 +47,8 @@ private static void AssertResponsesEqual(PluginCredentialResponse nsj, PluginCre
4947 [ InlineData ( @"{""Username"":""u"",""Password"":""p"",""AuthTypes"":[""basic"",""digest"",""negotiate"",""ntlm""]}" ) ]
5048 public void StjAndNsjProduceSameResult ( string json )
5149 {
52- var nsjResult = DeserializeWithNsj ( json ) ;
53- var stjResult = DeserializeWithStj ( json ) ;
50+ PluginCredentialResponse ? nsjResult = DeserializeWithNsj ( json ) ;
51+ PluginCredentialResponse ? stjResult = DeserializeWithStj ( json ) ;
5452
5553 AssertResponsesEqual ( nsjResult , stjResult ) ;
5654 }
@@ -59,8 +57,8 @@ public void StjAndNsjProduceSameResult(string json)
5957 [ InlineData ( "null" ) ]
6058 public void StjAndNsjBothReturnNull ( string json )
6159 {
62- var nsjResult = DeserializeWithNsj ( json ) ;
63- var stjResult = DeserializeWithStj ( json ) ;
60+ PluginCredentialResponse ? nsjResult = DeserializeWithNsj ( json ) ;
61+ PluginCredentialResponse ? stjResult = DeserializeWithStj ( json ) ;
6462
6563 Assert . Null ( nsjResult ) ;
6664 Assert . Null ( stjResult ) ;
0 commit comments