88using JsonApiDotNetCoreExample ;
99using JsonApiDotNetCoreExample . Data ;
1010using JsonApiDotNetCoreExample . Models ;
11+ using JsonApiDotNetCoreExampleTests . Helpers . Extensions ;
1112using Microsoft . AspNetCore ;
1213using Microsoft . AspNetCore . Hosting ;
1314using Microsoft . AspNetCore . TestHost ;
@@ -60,7 +61,7 @@ public async Task When_getting_existing_ToOne_relationship_it_should_succeed()
6061
6162 var json = JsonConvert . DeserializeObject < JObject > ( body ) . ToString ( ) ;
6263
63- Assert . Equal ( @"{
64+ string expected = @"{
6465 ""links"": {
6566 ""self"": ""http://localhost/api/v1/todoItems/" + todoItem . StringId + @"/relationships/owner"",
6667 ""related"": ""http://localhost/api/v1/todoItems/" + todoItem . StringId + @"/owner""
@@ -69,7 +70,8 @@ public async Task When_getting_existing_ToOne_relationship_it_should_succeed()
6970 ""type"": ""people"",
7071 ""id"": """ + todoItem . Owner . StringId + @"""
7172 }
72- }" , json ) ;
73+ }" ;
74+ Assert . Equal ( expected . NormalizeLineEndings ( ) , json . NormalizeLineEndings ( ) ) ;
7375 }
7476
7577 [ Fact ]
@@ -112,7 +114,7 @@ public async Task When_getting_existing_ToMany_relationship_it_should_succeed()
112114
113115 var json = JsonConvert . DeserializeObject < JObject > ( body ) . ToString ( ) ;
114116
115- Assert . Equal ( @"{
117+ var expected = @"{
116118 ""links"": {
117119 ""self"": ""http://localhost/api/v1/authors/" + author . StringId + @"/relationships/articles"",
118120 ""related"": ""http://localhost/api/v1/authors/" + author . StringId + @"/articles""
@@ -127,7 +129,9 @@ public async Task When_getting_existing_ToMany_relationship_it_should_succeed()
127129 ""id"": """ + author . Articles [ 1 ] . StringId + @"""
128130 }
129131 ]
130- }" , json ) ;
132+ }" ;
133+
134+ Assert . Equal ( expected . NormalizeLineEndings ( ) , json . NormalizeLineEndings ( ) ) ;
131135 }
132136
133137 [ Fact ]
@@ -156,7 +160,8 @@ public async Task When_getting_related_missing_to_one_resource_it_should_succeed
156160 Assert . Equal ( HttpStatusCode . OK , response . StatusCode ) ;
157161
158162 var json = JsonConvert . DeserializeObject < JObject > ( body ) . ToString ( ) ;
159- Assert . Equal ( @"{
163+
164+ var expected = @"{
160165 ""meta"": {
161166 ""copyright"": ""Copyright 2015 Example Corp."",
162167 ""authors"": [
@@ -169,7 +174,9 @@ public async Task When_getting_related_missing_to_one_resource_it_should_succeed
169174 ""self"": ""http://localhost/api/v1/todoItems/" + todoItem . StringId + @"/owner""
170175 },
171176 ""data"": null
172- }" , json ) ;
177+ }" ;
178+
179+ Assert . Equal ( expected . NormalizeLineEndings ( ) , json . NormalizeLineEndings ( ) ) ;
173180 }
174181
175182 [ Fact ]
0 commit comments