@@ -27,9 +27,9 @@ public async Task Getting_resource_collection_translates_response()
2727 const string flightDepartsAt = "2014-11-25T00:00:00" ;
2828 const string documentMetaValue = "1" ;
2929 const string flightMetaValue = "https://api.jsonapi.net/docs/#get-flights" ;
30- const string operatingAirplaneMetaValue = "https://jsonapi.net/api/docs/#get-flight-operating-airplane" ;
31- const string cabinPersonnelMetaValue = "https://jsonapi.net/api/docs/#get-flight-cabin-crew-members" ;
3230 const string purserMetaValue = "https://jsonapi.net/api/docs/#get-flight-purser" ;
31+ const string cabinPersonnelMetaValue = "https://jsonapi.net/api/docs/#get-flight-cabin-crew-members" ;
32+ const string passengersMetaValue = "https://jsonapi.net/api/docs/#get-flight-passengers" ;
3333 const string topLevelLink = HostPrefix + "flights" ;
3434 const string flightResourceLink = topLevelLink + "/" + flightId ;
3535
@@ -59,13 +59,13 @@ public async Task Getting_resource_collection_translates_response()
5959 ]
6060 },
6161 ""relationships"": {
62- ""operating-airplane "": {
62+ ""purser "": {
6363 ""links"": {
64- ""self"": """ + flightResourceLink + @"/relationships/operating-airplane "",
65- ""related"": """ + flightResourceLink + @"/operating-airplane ""
64+ ""self"": """ + flightResourceLink + @"/relationships/purser "",
65+ ""related"": """ + flightResourceLink + @"/purser ""
6666 },
6767 ""meta"": {
68- ""docs"": """ + operatingAirplaneMetaValue + @"""
68+ ""docs"": """ + purserMetaValue + @"""
6969 }
7070 },
7171 ""cabin-crew-members"": {
@@ -77,13 +77,13 @@ public async Task Getting_resource_collection_translates_response()
7777 ""docs"": """ + cabinPersonnelMetaValue + @"""
7878 }
7979 },
80- ""purser "": {
80+ ""passengers "": {
8181 ""links"": {
82- ""self"": """ + flightResourceLink + @"/relationships/purser "",
83- ""related"": """ + flightResourceLink + @"/purser ""
82+ ""self"": """ + flightResourceLink + @"/relationships/passengers "",
83+ ""related"": """ + flightResourceLink + @"/passengers ""
8484 },
8585 ""meta"": {
86- ""docs"": """ + purserMetaValue + @"""
86+ ""docs"": """ + passengersMetaValue + @"""
8787 }
8888 }
8989 },
@@ -128,23 +128,23 @@ public async Task Getting_resource_collection_translates_response()
128128 flight . Attributes . DepartsAt . Should ( ) . Be ( DateTimeOffset . Parse ( flightDepartsAt , new CultureInfo ( "en-GB" ) ) ) ;
129129 flight . Attributes . ArrivesAt . Should ( ) . Be ( null ) ;
130130
131- flight . Relationships . OperatingAirplane . Data . Should ( ) . BeNull ( ) ;
132- flight . Relationships . OperatingAirplane . Links . Self . Should ( ) . Be ( flightResourceLink + "/relationships/operating-airplane " ) ;
133- flight . Relationships . OperatingAirplane . Links . Related . Should ( ) . Be ( flightResourceLink + "/operating-airplane " ) ;
134- flight . Relationships . OperatingAirplane . Meta . Should ( ) . HaveCount ( 1 ) ;
135- flight . Relationships . OperatingAirplane . Meta [ "docs" ] . Should ( ) . Be ( operatingAirplaneMetaValue ) ;
131+ flight . Relationships . Purser . Data . Should ( ) . BeNull ( ) ;
132+ flight . Relationships . Purser . Links . Self . Should ( ) . Be ( flightResourceLink + "/relationships/purser " ) ;
133+ flight . Relationships . Purser . Links . Related . Should ( ) . Be ( flightResourceLink + "/purser " ) ;
134+ flight . Relationships . Purser . Meta . Should ( ) . HaveCount ( 1 ) ;
135+ flight . Relationships . Purser . Meta [ "docs" ] . Should ( ) . Be ( purserMetaValue ) ;
136136
137137 flight . Relationships . CabinCrewMembers . Data . Should ( ) . BeNull ( ) ;
138138 flight . Relationships . CabinCrewMembers . Links . Self . Should ( ) . Be ( flightResourceLink + "/relationships/cabin-crew-members" ) ;
139139 flight . Relationships . CabinCrewMembers . Links . Related . Should ( ) . Be ( flightResourceLink + "/cabin-crew-members" ) ;
140140 flight . Relationships . CabinCrewMembers . Meta . Should ( ) . HaveCount ( 1 ) ;
141141 flight . Relationships . CabinCrewMembers . Meta [ "docs" ] . Should ( ) . Be ( cabinPersonnelMetaValue ) ;
142142
143- flight . Relationships . Purser . Data . Should ( ) . BeNull ( ) ;
144- flight . Relationships . Purser . Links . Self . Should ( ) . Be ( flightResourceLink + "/relationships/purser " ) ;
145- flight . Relationships . Purser . Links . Related . Should ( ) . Be ( flightResourceLink + "/purser " ) ;
146- flight . Relationships . Purser . Meta . Should ( ) . HaveCount ( 1 ) ;
147- flight . Relationships . Purser . Meta [ "docs" ] . Should ( ) . Be ( purserMetaValue ) ;
143+ flight . Relationships . Passengers . Data . Should ( ) . BeNull ( ) ;
144+ flight . Relationships . Passengers . Links . Self . Should ( ) . Be ( flightResourceLink + "/relationships/passengers " ) ;
145+ flight . Relationships . Passengers . Links . Related . Should ( ) . Be ( flightResourceLink + "/passengers " ) ;
146+ flight . Relationships . Passengers . Meta . Should ( ) . HaveCount ( 1 ) ;
147+ flight . Relationships . Passengers . Meta [ "docs" ] . Should ( ) . Be ( passengersMetaValue ) ;
148148 }
149149
150150 [ Fact ]
@@ -230,16 +230,16 @@ public async Task Posting_resource_translates_response()
230230
231231 const string responseBody = @"{
232232 ""links"": {
233- ""self"": """ + HostPrefix + @"flights/" + flightId + @"&fields[flights]&include=operating-airplane ,cabin-crew-members,purser ""
233+ ""self"": """ + HostPrefix + @"flights/" + flightId + @"&fields[flights]&include=purser ,cabin-crew-members,passengers ""
234234 },
235235 ""data"": {
236236 ""type"": ""flights"",
237237 ""id"": """ + flightId + @""",
238238 ""relationships"": {
239- ""operating-airplane "": {
239+ ""purser "": {
240240 ""links"": {
241- ""self"": """ + HostPrefix + @"flights/" + flightId + @"/relationships/operating-airplane "",
242- ""related"": """ + HostPrefix + @"flights/" + flightId + @"/operating-airplane ""
241+ ""self"": """ + HostPrefix + @"flights/" + flightId + @"/relationships/purser "",
242+ ""related"": """ + HostPrefix + @"flights/" + flightId + @"/purser ""
243243 },
244244 ""data"": null
245245 },
@@ -255,16 +255,16 @@ public async Task Posting_resource_translates_response()
255255 }
256256 ],
257257 },
258- ""purser "": {
258+ ""passengers "": {
259259 ""links"": {
260- ""self"": """ + HostPrefix + @"flights/" + flightId + @"/relationships/purser "",
261- ""related"": """ + HostPrefix + @"flights/" + flightId + @"/purser ""
260+ ""self"": """ + HostPrefix + @"flights/" + flightId + @"/relationships/passengers "",
261+ ""related"": """ + HostPrefix + @"flights/" + flightId + @"/passengers ""
262262 },
263- ""data"": null
263+ ""data"": [ ]
264264 }
265265 },
266266 ""links"": {
267- ""self"": """ + HostPrefix + @"flights/" + flightId + @"&fields[flights]&include=operating-airplane ,cabin-crew-members,purser ""
267+ ""self"": """ + HostPrefix + @"flights/" + flightId + @"&fields[flights]&include=purser ,cabin-crew-members,passengers ""
268268 }
269269 }
270270}" ;
@@ -280,12 +280,12 @@ public async Task Posting_resource_translates_response()
280280 Type = FlightsResourceType . Flights ,
281281 Relationships = new FlightRelationshipsInPostRequest
282282 {
283- OperatingAirplane = new ToOneAirplaneRequestData
283+ Purser = new ToOneFlightAttendantRequestData
284284 {
285- Data = new AirplaneIdentifier
285+ Data = new FlightAttendantIdentifier
286286 {
287287 Id = "XxuIu" ,
288- Type = AirplanesResourceType . Airplanes
288+ Type = FlightAttendantsResourceType . FlightAttendants
289289 }
290290 }
291291 }
@@ -294,11 +294,11 @@ public async Task Posting_resource_translates_response()
294294
295295 // Assert
296296 document . Data . Attributes . Should ( ) . BeNull ( ) ;
297- document . Data . Relationships . OperatingAirplane . Data . Should ( ) . BeNull ( ) ;
297+ document . Data . Relationships . Purser . Data . Should ( ) . BeNull ( ) ;
298298 document . Data . Relationships . CabinCrewMembers . Data . Should ( ) . HaveCount ( 1 ) ;
299299 document . Data . Relationships . CabinCrewMembers . Data . First ( ) . Id . Should ( ) . Be ( flightAttendantId ) ;
300300 document . Data . Relationships . CabinCrewMembers . Data . First ( ) . Type . Should ( ) . Be ( FlightAttendantsResourceType . FlightAttendants ) ;
301- document . Data . Relationships . Purser . Data . Should ( ) . BeNull ( ) ;
301+ document . Data . Relationships . Passengers . Data . Should ( ) . BeEmpty ( ) ;
302302 }
303303
304304 [ Fact ]
@@ -315,7 +315,7 @@ public async Task Patching_resource_with_side_effects_translates_response()
315315 ""type"": ""flights"",
316316 ""id"": """ + flightId + @""",
317317 ""links"": {
318- ""self"": """ + HostPrefix + @"flights/" + flightId + @"&fields[flights]&include=operating-airplane ,cabin-crew-members,purser ""
318+ ""self"": """ + HostPrefix + @"flights/" + flightId + @"&fields[flights]&include=purser ,cabin-crew-members,passengers ""
319319 }
320320 }
321321}" ;
@@ -384,9 +384,9 @@ public async Task Getting_secondary_resource_translates_response()
384384
385385 const string responseBody = @"{
386386 ""links"": {
387- ""self"": """ + HostPrefix + @"flights/" + flightId + @"/operating-airplane "",
388- ""first"": """ + HostPrefix + @"flights/" + flightId + @"/operating-airplane "",
389- ""last"": """ + HostPrefix + @"flights/" + flightId + @"/operating-airplane ""
387+ ""self"": """ + HostPrefix + @"flights/" + flightId + @"/purser "",
388+ ""first"": """ + HostPrefix + @"flights/" + flightId + @"/purser "",
389+ ""last"": """ + HostPrefix + @"flights/" + flightId + @"/purser ""
390390 },
391391 ""data"": null
392392}" ;
@@ -395,7 +395,7 @@ public async Task Getting_secondary_resource_translates_response()
395395 IOpenApiClient openApiClient = new OpenApiClient ( wrapper . HttpClient ) ;
396396
397397 // Act
398- AirplaneSecondaryResponseDocument document = await openApiClient . GetFlightOperatingAirplaneAsync ( flightId ) ;
398+ FlightAttendantSecondaryResponseDocument document = await openApiClient . GetFlightPurserAsync ( flightId ) ;
399399
400400 // Assert
401401 document . Data . Should ( ) . BeNull ( ) ;
@@ -430,28 +430,28 @@ public async Task Getting_ToOne_relationship_translates_response()
430430 {
431431 // Arrange
432432 const string flightId = "ZvuH1" ;
433- const string operatingAirplaneId = "bBJHu" ;
433+ const string purserId = "bBJHu" ;
434434
435435 const string responseBody = @"{
436436 ""links"": {
437- ""self"": """ + HostPrefix + @"flights/" + flightId + @"/relationships/operating-airplane "",
438- ""related"": """ + HostPrefix + @"flights/" + flightId + @"/relationships/operating-airplane ""
437+ ""self"": """ + HostPrefix + @"flights/" + flightId + @"/relationships/purser "",
438+ ""related"": """ + HostPrefix + @"flights/" + flightId + @"/relationships/purser ""
439439 },
440440 ""data"": {
441- ""type"": ""airplanes "",
442- ""id"": """ + operatingAirplaneId + @"""
441+ ""type"": ""flight-attendants "",
442+ ""id"": """ + purserId + @"""
443443 }
444444}" ;
445445
446446 using var wrapper = FakeHttpClientWrapper . Create ( HttpStatusCode . OK , responseBody ) ;
447447 IOpenApiClient openApiClient = new OpenApiClient ( wrapper . HttpClient ) ;
448448
449449 // Act
450- AirplaneIdentifierResponseDocument document = await openApiClient . GetFlightOperatingAirplaneRelationshipAsync ( flightId ) ;
450+ FlightAttendantIdentifierResponseDocument document = await openApiClient . GetFlightPurserRelationshipAsync ( flightId ) ;
451451
452452 // Assert
453453 document . Data . Should ( ) . NotBeNull ( ) ;
454- document . Data . Id . Should ( ) . Be ( operatingAirplaneId ) ;
454+ document . Data . Id . Should ( ) . Be ( purserId ) ;
455455 document . Data . Type . Should ( ) . Be ( FlightAttendantsResourceType . FlightAttendants ) ;
456456 }
457457
@@ -463,12 +463,12 @@ public async Task Patching_ToOne_relationship_translates_response()
463463 IOpenApiClient openApiClient = new OpenApiClient ( wrapper . HttpClient ) ;
464464
465465 // Act
466- await openApiClient . PatchFlightOperatingAirplaneRelationshipAsync ( "ZvuH1" , new ToOneAirplaneRequestData
466+ await openApiClient . PatchFlightPurserRelationshipAsync ( "ZvuH1" , new ToOneFlightAttendantRequestData
467467 {
468- Data = new AirplaneIdentifier
468+ Data = new FlightAttendantIdentifier
469469 {
470470 Id = "Adk2a" ,
471- Type = AirplanesResourceType . Airplanes
471+ Type = FlightAttendantsResourceType . FlightAttendants
472472 }
473473 } ) ;
474474 }
0 commit comments