File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed
test/JsonApiDotNetCoreExampleTests/Acceptance/Extensibility Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change 99using System . Threading . Tasks ;
1010using System . Net ;
1111using System ;
12- using System . Diagnostics ;
12+ using Newtonsoft . Json ;
13+ using JsonApiDotNetCore . Models ;
14+ using System . Collections . Generic ;
1315
1416namespace JsonApiDotNetCoreExampleTests . Acceptance . Extensibility
1517{
@@ -32,12 +34,28 @@ public async Task Can_Implement_Custom_IResourceService_Without_EFAsync()
3234 // act
3335 var response = await client . SendAsync ( request ) ;
3436 var responseBody = await response . Content . ReadAsStringAsync ( ) ;
35- Console . WriteLine ( responseBody ) ;
3637 var deserializedBody = server . GetService < IJsonApiDeSerializer > ( )
3738 . DeserializeList < MyModel > ( responseBody ) ;
39+
40+ var expectedBody = JsonConvert . SerializeObject ( new Documents {
41+ Data = new List < DocumentData > {
42+ new DocumentData {
43+ Id = "1" ,
44+ Type = "my-models" ,
45+ Attributes = new Dictionary < string , object > {
46+ { "description" , "description" }
47+ }
48+ }
49+ }
50+ } , new JsonSerializerSettings {
51+ NullValueHandling = NullValueHandling . Ignore
52+ } )
53+ . Replace ( " " , string . Empty )
54+ . ToLower ( ) ;
3855
3956 // assert
4057 Assert . Equal ( HttpStatusCode . OK , response . StatusCode ) ;
58+ Assert . Equal ( expectedBody , responseBody ) ;
4159 }
4260 }
4361}
You can’t perform that action at this time.
0 commit comments