9
9
using OpenApiClientTests . LegacyClient . GeneratedCode ;
10
10
using Xunit ;
11
11
12
- #pragma warning disable AV1704 // Don't include numbers in variables, parameters and type members
13
-
14
12
namespace OpenApiClientTests . LegacyClient
15
13
{
16
14
public sealed class ResponseTests
@@ -22,13 +20,13 @@ public async Task Getting_resource_collection_translates_response()
22
20
{
23
21
// Arrange
24
22
const string flightId = "ZvuH1" ;
25
- const string flightDestination = "Destination of Flight " ;
26
- const string fightServiceOnBoard = "Movies" ;
23
+ const string flightDestination = "Amsterdam " ;
24
+ const string flightServiceOnBoard = "Movies" ;
27
25
const string flightDepartsAt = "2014-11-25T00:00:00" ;
28
26
const string documentMetaValue = "1" ;
29
- const string flightMetaValue = "https://api. jsonapi.net/docs/#get-flights" ;
27
+ const string flightMetaValue = "https://jsonapi.net/api /docs/#get-flights" ;
30
28
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" ;
29
+ const string cabinCrewMembersMetaValue = "https://jsonapi.net/api/docs/#get-flight-cabin-crew-members" ;
32
30
const string passengersMetaValue = "https://jsonapi.net/api/docs/#get-flight-passengers" ;
33
31
const string topLevelLink = HostPrefix + "flights" ;
34
32
const string flightResourceLink = topLevelLink + "/" + flightId ;
@@ -53,7 +51,7 @@ public async Task Getting_resource_collection_translates_response()
53
51
""departs-at"": """ + flightDepartsAt + @""",
54
52
""arrives-at"": null,
55
53
""services-on-board"": [
56
- """ + fightServiceOnBoard + @""",
54
+ """ + flightServiceOnBoard + @""",
57
55
"""",
58
56
null
59
57
]
@@ -74,7 +72,7 @@ public async Task Getting_resource_collection_translates_response()
74
72
""related"": """ + flightResourceLink + @"/cabin-crew-members""
75
73
},
76
74
""meta"": {
77
- ""docs"": """ + cabinPersonnelMetaValue + @"""
75
+ ""docs"": """ + cabinCrewMembersMetaValue + @"""
78
76
}
79
77
},
80
78
""passengers"": {
@@ -120,13 +118,14 @@ public async Task Getting_resource_collection_translates_response()
120
118
flight . Meta [ "docs" ] . Should ( ) . Be ( flightMetaValue ) ;
121
119
122
120
flight . Attributes . FinalDestination . Should ( ) . Be ( flightDestination ) ;
121
+ flight . Attributes . StopOverDestination . Should ( ) . Be ( null ) ;
123
122
flight . Attributes . ServicesOnBoard . Should ( ) . HaveCount ( 3 ) ;
124
- flight . Attributes . ServicesOnBoard . ElementAt ( 0 ) . Should ( ) . Be ( fightServiceOnBoard ) ;
123
+ flight . Attributes . ServicesOnBoard . ElementAt ( 0 ) . Should ( ) . Be ( flightServiceOnBoard ) ;
125
124
flight . Attributes . ServicesOnBoard . ElementAt ( 1 ) . Should ( ) . Be ( string . Empty ) ;
126
125
flight . Attributes . ServicesOnBoard . ElementAt ( 2 ) . Should ( ) . BeNull ( ) ;
127
126
flight . Attributes . OperatedBy . Should ( ) . Be ( Airline . DeltaAirLines ) ;
128
127
flight . Attributes . DepartsAt . Should ( ) . Be ( DateTimeOffset . Parse ( flightDepartsAt , new CultureInfo ( "en-GB" ) ) ) ;
129
- flight . Attributes . ArrivesAt . Should ( ) . Be ( null ) ;
128
+ flight . Attributes . ArrivesAt . Should ( ) . BeNull ( ) ;
130
129
131
130
flight . Relationships . Purser . Data . Should ( ) . BeNull ( ) ;
132
131
flight . Relationships . Purser . Links . Self . Should ( ) . Be ( flightResourceLink + "/relationships/purser" ) ;
@@ -138,7 +137,7 @@ public async Task Getting_resource_collection_translates_response()
138
137
flight . Relationships . CabinCrewMembers . Links . Self . Should ( ) . Be ( flightResourceLink + "/relationships/cabin-crew-members" ) ;
139
138
flight . Relationships . CabinCrewMembers . Links . Related . Should ( ) . Be ( flightResourceLink + "/cabin-crew-members" ) ;
140
139
flight . Relationships . CabinCrewMembers . Meta . Should ( ) . HaveCount ( 1 ) ;
141
- flight . Relationships . CabinCrewMembers . Meta [ "docs" ] . Should ( ) . Be ( cabinPersonnelMetaValue ) ;
140
+ flight . Relationships . CabinCrewMembers . Meta [ "docs" ] . Should ( ) . Be ( cabinCrewMembersMetaValue ) ;
142
141
143
142
flight . Relationships . Passengers . Data . Should ( ) . BeNull ( ) ;
144
143
flight . Relationships . Passengers . Links . Self . Should ( ) . Be ( flightResourceLink + "/relationships/passengers" ) ;
@@ -187,6 +186,8 @@ public async Task Getting_resource_translates_response()
187
186
document . Data . Attributes . ArrivesAt . Should ( ) . Be ( DateTimeOffset . Parse ( arrivesAtWithUtcOffset ) ) ;
188
187
document . Data . Attributes . ServicesOnBoard . Should ( ) . BeNull ( ) ;
189
188
document . Data . Attributes . FinalDestination . Should ( ) . BeNull ( ) ;
189
+ document . Data . Attributes . StopOverDestination . Should ( ) . BeNull ( ) ;
190
+
190
191
document . Data . Attributes . OperatedBy . Should ( ) . Be ( default ( Airline ) ) ;
191
192
}
192
193
0 commit comments