File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed
JsonApiDotNetCoreExampleTests/IntegrationTests Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,8 @@ public async Task Can_create_user_with_password()
77
77
User responseUser = GetResponseDeserializer ( ) . DeserializeSingle < User > ( responseDocument ) . Data ;
78
78
var document = JsonConvert . DeserializeObject < Document > ( responseDocument ) ;
79
79
80
- document . SingleData . Attributes . Should ( ) . NotContainKey ( "password" ) ;
80
+ document . Should ( ) . NotBeNull ( ) ;
81
+ document ! . SingleData . Attributes . Should ( ) . NotContainKey ( "password" ) ;
81
82
document . SingleData . Attributes [ "userName" ] . Should ( ) . Be ( newUser . UserName ) ;
82
83
83
84
await _testContext . RunOnDatabaseAsync ( async dbContext =>
Original file line number Diff line number Diff line change @@ -283,7 +283,9 @@ public async Task Cannot_get_unknown_primary_resource_by_ID()
283
283
httpResponse . Should ( ) . HaveStatusCode ( HttpStatusCode . NotFound ) ;
284
284
285
285
var jObject = JsonConvert . DeserializeObject < JObject > ( responseDocument ) ;
286
- string errorId = jObject [ "errors" ] . Should ( ) . NotBeNull ( ) . And . Subject . Select ( element => ( string ) element [ "id" ] ) . Single ( ) ;
286
+ jObject . Should ( ) . NotBeNull ( ) ;
287
+
288
+ string errorId = jObject ! [ "errors" ] . Should ( ) . NotBeNull ( ) . And . Subject . Select ( element => ( string ) element [ "id" ] ) . Single ( ) ;
287
289
288
290
responseDocument . Should ( ) . BeJson ( @"{
289
291
""errors"": [
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ private static async Task<string> GetFormattedContentAsync(HttpResponseMessage r
47
47
{
48
48
if ( text . Length > 0 )
49
49
{
50
- return JsonConvert . DeserializeObject < JObject > ( text ) . ToString ( ) ;
50
+ return JsonConvert . DeserializeObject < JObject > ( text ) ? . ToString ( ) ;
51
51
}
52
52
}
53
53
#pragma warning disable AV1210 // Catch a specific exception instead of Exception, SystemException or ApplicationException
You can’t perform that action at this time.
0 commit comments