OLD | NEW |
(Empty) | |
| 1 library googleapis.qpxExpress.v1.test; |
| 2 |
| 3 import "dart:core" as core; |
| 4 import "dart:collection" as collection; |
| 5 import "dart:async" as async; |
| 6 import "dart:convert" as convert; |
| 7 |
| 8 import 'package:http/http.dart' as http; |
| 9 import 'package:http/testing.dart' as http_testing; |
| 10 import 'package:unittest/unittest.dart' as unittest; |
| 11 import 'package:googleapis/common/common.dart' as common; |
| 12 import 'package:googleapis/src/common_internal.dart' as common_internal; |
| 13 import '../common/common_internal_test.dart' as common_test; |
| 14 |
| 15 import 'package:googleapis/qpxexpress/v1.dart' as api; |
| 16 |
| 17 |
| 18 |
| 19 core.int buildCounterAircraftData = 0; |
| 20 buildAircraftData() { |
| 21 var o = new api.AircraftData(); |
| 22 buildCounterAircraftData++; |
| 23 if (buildCounterAircraftData < 3) { |
| 24 o.code = "foo"; |
| 25 o.kind = "foo"; |
| 26 o.name = "foo"; |
| 27 } |
| 28 buildCounterAircraftData--; |
| 29 return o; |
| 30 } |
| 31 |
| 32 checkAircraftData(api.AircraftData o) { |
| 33 buildCounterAircraftData++; |
| 34 if (buildCounterAircraftData < 3) { |
| 35 unittest.expect(o.code, unittest.equals('foo')); |
| 36 unittest.expect(o.kind, unittest.equals('foo')); |
| 37 unittest.expect(o.name, unittest.equals('foo')); |
| 38 } |
| 39 buildCounterAircraftData--; |
| 40 } |
| 41 |
| 42 core.int buildCounterAirportData = 0; |
| 43 buildAirportData() { |
| 44 var o = new api.AirportData(); |
| 45 buildCounterAirportData++; |
| 46 if (buildCounterAirportData < 3) { |
| 47 o.city = "foo"; |
| 48 o.code = "foo"; |
| 49 o.kind = "foo"; |
| 50 o.name = "foo"; |
| 51 } |
| 52 buildCounterAirportData--; |
| 53 return o; |
| 54 } |
| 55 |
| 56 checkAirportData(api.AirportData o) { |
| 57 buildCounterAirportData++; |
| 58 if (buildCounterAirportData < 3) { |
| 59 unittest.expect(o.city, unittest.equals('foo')); |
| 60 unittest.expect(o.code, unittest.equals('foo')); |
| 61 unittest.expect(o.kind, unittest.equals('foo')); |
| 62 unittest.expect(o.name, unittest.equals('foo')); |
| 63 } |
| 64 buildCounterAirportData--; |
| 65 } |
| 66 |
| 67 buildUnnamed1() { |
| 68 var o = new core.List<core.String>(); |
| 69 o.add("foo"); |
| 70 o.add("foo"); |
| 71 return o; |
| 72 } |
| 73 |
| 74 checkUnnamed1(core.List<core.String> o) { |
| 75 unittest.expect(o, unittest.hasLength(2)); |
| 76 unittest.expect(o[0], unittest.equals('foo')); |
| 77 unittest.expect(o[1], unittest.equals('foo')); |
| 78 } |
| 79 |
| 80 core.int buildCounterBagDescriptor = 0; |
| 81 buildBagDescriptor() { |
| 82 var o = new api.BagDescriptor(); |
| 83 buildCounterBagDescriptor++; |
| 84 if (buildCounterBagDescriptor < 3) { |
| 85 o.commercialName = "foo"; |
| 86 o.count = 42; |
| 87 o.description = buildUnnamed1(); |
| 88 o.kind = "foo"; |
| 89 o.subcode = "foo"; |
| 90 } |
| 91 buildCounterBagDescriptor--; |
| 92 return o; |
| 93 } |
| 94 |
| 95 checkBagDescriptor(api.BagDescriptor o) { |
| 96 buildCounterBagDescriptor++; |
| 97 if (buildCounterBagDescriptor < 3) { |
| 98 unittest.expect(o.commercialName, unittest.equals('foo')); |
| 99 unittest.expect(o.count, unittest.equals(42)); |
| 100 checkUnnamed1(o.description); |
| 101 unittest.expect(o.kind, unittest.equals('foo')); |
| 102 unittest.expect(o.subcode, unittest.equals('foo')); |
| 103 } |
| 104 buildCounterBagDescriptor--; |
| 105 } |
| 106 |
| 107 core.int buildCounterCarrierData = 0; |
| 108 buildCarrierData() { |
| 109 var o = new api.CarrierData(); |
| 110 buildCounterCarrierData++; |
| 111 if (buildCounterCarrierData < 3) { |
| 112 o.code = "foo"; |
| 113 o.kind = "foo"; |
| 114 o.name = "foo"; |
| 115 } |
| 116 buildCounterCarrierData--; |
| 117 return o; |
| 118 } |
| 119 |
| 120 checkCarrierData(api.CarrierData o) { |
| 121 buildCounterCarrierData++; |
| 122 if (buildCounterCarrierData < 3) { |
| 123 unittest.expect(o.code, unittest.equals('foo')); |
| 124 unittest.expect(o.kind, unittest.equals('foo')); |
| 125 unittest.expect(o.name, unittest.equals('foo')); |
| 126 } |
| 127 buildCounterCarrierData--; |
| 128 } |
| 129 |
| 130 core.int buildCounterCityData = 0; |
| 131 buildCityData() { |
| 132 var o = new api.CityData(); |
| 133 buildCounterCityData++; |
| 134 if (buildCounterCityData < 3) { |
| 135 o.code = "foo"; |
| 136 o.country = "foo"; |
| 137 o.kind = "foo"; |
| 138 o.name = "foo"; |
| 139 } |
| 140 buildCounterCityData--; |
| 141 return o; |
| 142 } |
| 143 |
| 144 checkCityData(api.CityData o) { |
| 145 buildCounterCityData++; |
| 146 if (buildCounterCityData < 3) { |
| 147 unittest.expect(o.code, unittest.equals('foo')); |
| 148 unittest.expect(o.country, unittest.equals('foo')); |
| 149 unittest.expect(o.kind, unittest.equals('foo')); |
| 150 unittest.expect(o.name, unittest.equals('foo')); |
| 151 } |
| 152 buildCounterCityData--; |
| 153 } |
| 154 |
| 155 buildUnnamed2() { |
| 156 var o = new core.List<api.AircraftData>(); |
| 157 o.add(buildAircraftData()); |
| 158 o.add(buildAircraftData()); |
| 159 return o; |
| 160 } |
| 161 |
| 162 checkUnnamed2(core.List<api.AircraftData> o) { |
| 163 unittest.expect(o, unittest.hasLength(2)); |
| 164 checkAircraftData(o[0]); |
| 165 checkAircraftData(o[1]); |
| 166 } |
| 167 |
| 168 buildUnnamed3() { |
| 169 var o = new core.List<api.AirportData>(); |
| 170 o.add(buildAirportData()); |
| 171 o.add(buildAirportData()); |
| 172 return o; |
| 173 } |
| 174 |
| 175 checkUnnamed3(core.List<api.AirportData> o) { |
| 176 unittest.expect(o, unittest.hasLength(2)); |
| 177 checkAirportData(o[0]); |
| 178 checkAirportData(o[1]); |
| 179 } |
| 180 |
| 181 buildUnnamed4() { |
| 182 var o = new core.List<api.CarrierData>(); |
| 183 o.add(buildCarrierData()); |
| 184 o.add(buildCarrierData()); |
| 185 return o; |
| 186 } |
| 187 |
| 188 checkUnnamed4(core.List<api.CarrierData> o) { |
| 189 unittest.expect(o, unittest.hasLength(2)); |
| 190 checkCarrierData(o[0]); |
| 191 checkCarrierData(o[1]); |
| 192 } |
| 193 |
| 194 buildUnnamed5() { |
| 195 var o = new core.List<api.CityData>(); |
| 196 o.add(buildCityData()); |
| 197 o.add(buildCityData()); |
| 198 return o; |
| 199 } |
| 200 |
| 201 checkUnnamed5(core.List<api.CityData> o) { |
| 202 unittest.expect(o, unittest.hasLength(2)); |
| 203 checkCityData(o[0]); |
| 204 checkCityData(o[1]); |
| 205 } |
| 206 |
| 207 buildUnnamed6() { |
| 208 var o = new core.List<api.TaxData>(); |
| 209 o.add(buildTaxData()); |
| 210 o.add(buildTaxData()); |
| 211 return o; |
| 212 } |
| 213 |
| 214 checkUnnamed6(core.List<api.TaxData> o) { |
| 215 unittest.expect(o, unittest.hasLength(2)); |
| 216 checkTaxData(o[0]); |
| 217 checkTaxData(o[1]); |
| 218 } |
| 219 |
| 220 core.int buildCounterData = 0; |
| 221 buildData() { |
| 222 var o = new api.Data(); |
| 223 buildCounterData++; |
| 224 if (buildCounterData < 3) { |
| 225 o.aircraft = buildUnnamed2(); |
| 226 o.airport = buildUnnamed3(); |
| 227 o.carrier = buildUnnamed4(); |
| 228 o.city = buildUnnamed5(); |
| 229 o.kind = "foo"; |
| 230 o.tax = buildUnnamed6(); |
| 231 } |
| 232 buildCounterData--; |
| 233 return o; |
| 234 } |
| 235 |
| 236 checkData(api.Data o) { |
| 237 buildCounterData++; |
| 238 if (buildCounterData < 3) { |
| 239 checkUnnamed2(o.aircraft); |
| 240 checkUnnamed3(o.airport); |
| 241 checkUnnamed4(o.carrier); |
| 242 checkUnnamed5(o.city); |
| 243 unittest.expect(o.kind, unittest.equals('foo')); |
| 244 checkUnnamed6(o.tax); |
| 245 } |
| 246 buildCounterData--; |
| 247 } |
| 248 |
| 249 core.int buildCounterFareInfo = 0; |
| 250 buildFareInfo() { |
| 251 var o = new api.FareInfo(); |
| 252 buildCounterFareInfo++; |
| 253 if (buildCounterFareInfo < 3) { |
| 254 o.basisCode = "foo"; |
| 255 o.carrier = "foo"; |
| 256 o.destination = "foo"; |
| 257 o.id = "foo"; |
| 258 o.kind = "foo"; |
| 259 o.origin = "foo"; |
| 260 o.private = true; |
| 261 } |
| 262 buildCounterFareInfo--; |
| 263 return o; |
| 264 } |
| 265 |
| 266 checkFareInfo(api.FareInfo o) { |
| 267 buildCounterFareInfo++; |
| 268 if (buildCounterFareInfo < 3) { |
| 269 unittest.expect(o.basisCode, unittest.equals('foo')); |
| 270 unittest.expect(o.carrier, unittest.equals('foo')); |
| 271 unittest.expect(o.destination, unittest.equals('foo')); |
| 272 unittest.expect(o.id, unittest.equals('foo')); |
| 273 unittest.expect(o.kind, unittest.equals('foo')); |
| 274 unittest.expect(o.origin, unittest.equals('foo')); |
| 275 unittest.expect(o.private, unittest.isTrue); |
| 276 } |
| 277 buildCounterFareInfo--; |
| 278 } |
| 279 |
| 280 core.int buildCounterFlightInfo = 0; |
| 281 buildFlightInfo() { |
| 282 var o = new api.FlightInfo(); |
| 283 buildCounterFlightInfo++; |
| 284 if (buildCounterFlightInfo < 3) { |
| 285 o.carrier = "foo"; |
| 286 o.number = "foo"; |
| 287 } |
| 288 buildCounterFlightInfo--; |
| 289 return o; |
| 290 } |
| 291 |
| 292 checkFlightInfo(api.FlightInfo o) { |
| 293 buildCounterFlightInfo++; |
| 294 if (buildCounterFlightInfo < 3) { |
| 295 unittest.expect(o.carrier, unittest.equals('foo')); |
| 296 unittest.expect(o.number, unittest.equals('foo')); |
| 297 } |
| 298 buildCounterFlightInfo--; |
| 299 } |
| 300 |
| 301 buildUnnamed7() { |
| 302 var o = new core.List<api.BagDescriptor>(); |
| 303 o.add(buildBagDescriptor()); |
| 304 o.add(buildBagDescriptor()); |
| 305 return o; |
| 306 } |
| 307 |
| 308 checkUnnamed7(core.List<api.BagDescriptor> o) { |
| 309 unittest.expect(o, unittest.hasLength(2)); |
| 310 checkBagDescriptor(o[0]); |
| 311 checkBagDescriptor(o[1]); |
| 312 } |
| 313 |
| 314 core.int buildCounterFreeBaggageAllowance = 0; |
| 315 buildFreeBaggageAllowance() { |
| 316 var o = new api.FreeBaggageAllowance(); |
| 317 buildCounterFreeBaggageAllowance++; |
| 318 if (buildCounterFreeBaggageAllowance < 3) { |
| 319 o.bagDescriptor = buildUnnamed7(); |
| 320 o.kilos = 42; |
| 321 o.kilosPerPiece = 42; |
| 322 o.kind = "foo"; |
| 323 o.pieces = 42; |
| 324 o.pounds = 42; |
| 325 } |
| 326 buildCounterFreeBaggageAllowance--; |
| 327 return o; |
| 328 } |
| 329 |
| 330 checkFreeBaggageAllowance(api.FreeBaggageAllowance o) { |
| 331 buildCounterFreeBaggageAllowance++; |
| 332 if (buildCounterFreeBaggageAllowance < 3) { |
| 333 checkUnnamed7(o.bagDescriptor); |
| 334 unittest.expect(o.kilos, unittest.equals(42)); |
| 335 unittest.expect(o.kilosPerPiece, unittest.equals(42)); |
| 336 unittest.expect(o.kind, unittest.equals('foo')); |
| 337 unittest.expect(o.pieces, unittest.equals(42)); |
| 338 unittest.expect(o.pounds, unittest.equals(42)); |
| 339 } |
| 340 buildCounterFreeBaggageAllowance--; |
| 341 } |
| 342 |
| 343 core.int buildCounterLegInfo = 0; |
| 344 buildLegInfo() { |
| 345 var o = new api.LegInfo(); |
| 346 buildCounterLegInfo++; |
| 347 if (buildCounterLegInfo < 3) { |
| 348 o.aircraft = "foo"; |
| 349 o.arrivalTime = "foo"; |
| 350 o.changePlane = true; |
| 351 o.connectionDuration = 42; |
| 352 o.departureTime = "foo"; |
| 353 o.destination = "foo"; |
| 354 o.destinationTerminal = "foo"; |
| 355 o.duration = 42; |
| 356 o.id = "foo"; |
| 357 o.kind = "foo"; |
| 358 o.meal = "foo"; |
| 359 o.mileage = 42; |
| 360 o.onTimePerformance = 42; |
| 361 o.operatingDisclosure = "foo"; |
| 362 o.origin = "foo"; |
| 363 o.originTerminal = "foo"; |
| 364 o.secure = true; |
| 365 } |
| 366 buildCounterLegInfo--; |
| 367 return o; |
| 368 } |
| 369 |
| 370 checkLegInfo(api.LegInfo o) { |
| 371 buildCounterLegInfo++; |
| 372 if (buildCounterLegInfo < 3) { |
| 373 unittest.expect(o.aircraft, unittest.equals('foo')); |
| 374 unittest.expect(o.arrivalTime, unittest.equals('foo')); |
| 375 unittest.expect(o.changePlane, unittest.isTrue); |
| 376 unittest.expect(o.connectionDuration, unittest.equals(42)); |
| 377 unittest.expect(o.departureTime, unittest.equals('foo')); |
| 378 unittest.expect(o.destination, unittest.equals('foo')); |
| 379 unittest.expect(o.destinationTerminal, unittest.equals('foo')); |
| 380 unittest.expect(o.duration, unittest.equals(42)); |
| 381 unittest.expect(o.id, unittest.equals('foo')); |
| 382 unittest.expect(o.kind, unittest.equals('foo')); |
| 383 unittest.expect(o.meal, unittest.equals('foo')); |
| 384 unittest.expect(o.mileage, unittest.equals(42)); |
| 385 unittest.expect(o.onTimePerformance, unittest.equals(42)); |
| 386 unittest.expect(o.operatingDisclosure, unittest.equals('foo')); |
| 387 unittest.expect(o.origin, unittest.equals('foo')); |
| 388 unittest.expect(o.originTerminal, unittest.equals('foo')); |
| 389 unittest.expect(o.secure, unittest.isTrue); |
| 390 } |
| 391 buildCounterLegInfo--; |
| 392 } |
| 393 |
| 394 core.int buildCounterPassengerCounts = 0; |
| 395 buildPassengerCounts() { |
| 396 var o = new api.PassengerCounts(); |
| 397 buildCounterPassengerCounts++; |
| 398 if (buildCounterPassengerCounts < 3) { |
| 399 o.adultCount = 42; |
| 400 o.childCount = 42; |
| 401 o.infantInLapCount = 42; |
| 402 o.infantInSeatCount = 42; |
| 403 o.kind = "foo"; |
| 404 o.seniorCount = 42; |
| 405 } |
| 406 buildCounterPassengerCounts--; |
| 407 return o; |
| 408 } |
| 409 |
| 410 checkPassengerCounts(api.PassengerCounts o) { |
| 411 buildCounterPassengerCounts++; |
| 412 if (buildCounterPassengerCounts < 3) { |
| 413 unittest.expect(o.adultCount, unittest.equals(42)); |
| 414 unittest.expect(o.childCount, unittest.equals(42)); |
| 415 unittest.expect(o.infantInLapCount, unittest.equals(42)); |
| 416 unittest.expect(o.infantInSeatCount, unittest.equals(42)); |
| 417 unittest.expect(o.kind, unittest.equals('foo')); |
| 418 unittest.expect(o.seniorCount, unittest.equals(42)); |
| 419 } |
| 420 buildCounterPassengerCounts--; |
| 421 } |
| 422 |
| 423 buildUnnamed8() { |
| 424 var o = new core.List<api.FareInfo>(); |
| 425 o.add(buildFareInfo()); |
| 426 o.add(buildFareInfo()); |
| 427 return o; |
| 428 } |
| 429 |
| 430 checkUnnamed8(core.List<api.FareInfo> o) { |
| 431 unittest.expect(o, unittest.hasLength(2)); |
| 432 checkFareInfo(o[0]); |
| 433 checkFareInfo(o[1]); |
| 434 } |
| 435 |
| 436 buildUnnamed9() { |
| 437 var o = new core.List<api.SegmentPricing>(); |
| 438 o.add(buildSegmentPricing()); |
| 439 o.add(buildSegmentPricing()); |
| 440 return o; |
| 441 } |
| 442 |
| 443 checkUnnamed9(core.List<api.SegmentPricing> o) { |
| 444 unittest.expect(o, unittest.hasLength(2)); |
| 445 checkSegmentPricing(o[0]); |
| 446 checkSegmentPricing(o[1]); |
| 447 } |
| 448 |
| 449 buildUnnamed10() { |
| 450 var o = new core.List<api.TaxInfo>(); |
| 451 o.add(buildTaxInfo()); |
| 452 o.add(buildTaxInfo()); |
| 453 return o; |
| 454 } |
| 455 |
| 456 checkUnnamed10(core.List<api.TaxInfo> o) { |
| 457 unittest.expect(o, unittest.hasLength(2)); |
| 458 checkTaxInfo(o[0]); |
| 459 checkTaxInfo(o[1]); |
| 460 } |
| 461 |
| 462 core.int buildCounterPricingInfo = 0; |
| 463 buildPricingInfo() { |
| 464 var o = new api.PricingInfo(); |
| 465 buildCounterPricingInfo++; |
| 466 if (buildCounterPricingInfo < 3) { |
| 467 o.baseFareTotal = "foo"; |
| 468 o.fare = buildUnnamed8(); |
| 469 o.fareCalculation = "foo"; |
| 470 o.kind = "foo"; |
| 471 o.latestTicketingTime = "foo"; |
| 472 o.passengers = buildPassengerCounts(); |
| 473 o.ptc = "foo"; |
| 474 o.refundable = true; |
| 475 o.saleFareTotal = "foo"; |
| 476 o.saleTaxTotal = "foo"; |
| 477 o.saleTotal = "foo"; |
| 478 o.segmentPricing = buildUnnamed9(); |
| 479 o.tax = buildUnnamed10(); |
| 480 } |
| 481 buildCounterPricingInfo--; |
| 482 return o; |
| 483 } |
| 484 |
| 485 checkPricingInfo(api.PricingInfo o) { |
| 486 buildCounterPricingInfo++; |
| 487 if (buildCounterPricingInfo < 3) { |
| 488 unittest.expect(o.baseFareTotal, unittest.equals('foo')); |
| 489 checkUnnamed8(o.fare); |
| 490 unittest.expect(o.fareCalculation, unittest.equals('foo')); |
| 491 unittest.expect(o.kind, unittest.equals('foo')); |
| 492 unittest.expect(o.latestTicketingTime, unittest.equals('foo')); |
| 493 checkPassengerCounts(o.passengers); |
| 494 unittest.expect(o.ptc, unittest.equals('foo')); |
| 495 unittest.expect(o.refundable, unittest.isTrue); |
| 496 unittest.expect(o.saleFareTotal, unittest.equals('foo')); |
| 497 unittest.expect(o.saleTaxTotal, unittest.equals('foo')); |
| 498 unittest.expect(o.saleTotal, unittest.equals('foo')); |
| 499 checkUnnamed9(o.segmentPricing); |
| 500 checkUnnamed10(o.tax); |
| 501 } |
| 502 buildCounterPricingInfo--; |
| 503 } |
| 504 |
| 505 buildUnnamed11() { |
| 506 var o = new core.List<api.LegInfo>(); |
| 507 o.add(buildLegInfo()); |
| 508 o.add(buildLegInfo()); |
| 509 return o; |
| 510 } |
| 511 |
| 512 checkUnnamed11(core.List<api.LegInfo> o) { |
| 513 unittest.expect(o, unittest.hasLength(2)); |
| 514 checkLegInfo(o[0]); |
| 515 checkLegInfo(o[1]); |
| 516 } |
| 517 |
| 518 core.int buildCounterSegmentInfo = 0; |
| 519 buildSegmentInfo() { |
| 520 var o = new api.SegmentInfo(); |
| 521 buildCounterSegmentInfo++; |
| 522 if (buildCounterSegmentInfo < 3) { |
| 523 o.bookingCode = "foo"; |
| 524 o.bookingCodeCount = 42; |
| 525 o.cabin = "foo"; |
| 526 o.connectionDuration = 42; |
| 527 o.duration = 42; |
| 528 o.flight = buildFlightInfo(); |
| 529 o.id = "foo"; |
| 530 o.kind = "foo"; |
| 531 o.leg = buildUnnamed11(); |
| 532 o.marriedSegmentGroup = "foo"; |
| 533 o.subjectToGovernmentApproval = true; |
| 534 } |
| 535 buildCounterSegmentInfo--; |
| 536 return o; |
| 537 } |
| 538 |
| 539 checkSegmentInfo(api.SegmentInfo o) { |
| 540 buildCounterSegmentInfo++; |
| 541 if (buildCounterSegmentInfo < 3) { |
| 542 unittest.expect(o.bookingCode, unittest.equals('foo')); |
| 543 unittest.expect(o.bookingCodeCount, unittest.equals(42)); |
| 544 unittest.expect(o.cabin, unittest.equals('foo')); |
| 545 unittest.expect(o.connectionDuration, unittest.equals(42)); |
| 546 unittest.expect(o.duration, unittest.equals(42)); |
| 547 checkFlightInfo(o.flight); |
| 548 unittest.expect(o.id, unittest.equals('foo')); |
| 549 unittest.expect(o.kind, unittest.equals('foo')); |
| 550 checkUnnamed11(o.leg); |
| 551 unittest.expect(o.marriedSegmentGroup, unittest.equals('foo')); |
| 552 unittest.expect(o.subjectToGovernmentApproval, unittest.isTrue); |
| 553 } |
| 554 buildCounterSegmentInfo--; |
| 555 } |
| 556 |
| 557 buildUnnamed12() { |
| 558 var o = new core.List<api.FreeBaggageAllowance>(); |
| 559 o.add(buildFreeBaggageAllowance()); |
| 560 o.add(buildFreeBaggageAllowance()); |
| 561 return o; |
| 562 } |
| 563 |
| 564 checkUnnamed12(core.List<api.FreeBaggageAllowance> o) { |
| 565 unittest.expect(o, unittest.hasLength(2)); |
| 566 checkFreeBaggageAllowance(o[0]); |
| 567 checkFreeBaggageAllowance(o[1]); |
| 568 } |
| 569 |
| 570 core.int buildCounterSegmentPricing = 0; |
| 571 buildSegmentPricing() { |
| 572 var o = new api.SegmentPricing(); |
| 573 buildCounterSegmentPricing++; |
| 574 if (buildCounterSegmentPricing < 3) { |
| 575 o.fareId = "foo"; |
| 576 o.freeBaggageOption = buildUnnamed12(); |
| 577 o.kind = "foo"; |
| 578 o.segmentId = "foo"; |
| 579 } |
| 580 buildCounterSegmentPricing--; |
| 581 return o; |
| 582 } |
| 583 |
| 584 checkSegmentPricing(api.SegmentPricing o) { |
| 585 buildCounterSegmentPricing++; |
| 586 if (buildCounterSegmentPricing < 3) { |
| 587 unittest.expect(o.fareId, unittest.equals('foo')); |
| 588 checkUnnamed12(o.freeBaggageOption); |
| 589 unittest.expect(o.kind, unittest.equals('foo')); |
| 590 unittest.expect(o.segmentId, unittest.equals('foo')); |
| 591 } |
| 592 buildCounterSegmentPricing--; |
| 593 } |
| 594 |
| 595 buildUnnamed13() { |
| 596 var o = new core.List<api.SegmentInfo>(); |
| 597 o.add(buildSegmentInfo()); |
| 598 o.add(buildSegmentInfo()); |
| 599 return o; |
| 600 } |
| 601 |
| 602 checkUnnamed13(core.List<api.SegmentInfo> o) { |
| 603 unittest.expect(o, unittest.hasLength(2)); |
| 604 checkSegmentInfo(o[0]); |
| 605 checkSegmentInfo(o[1]); |
| 606 } |
| 607 |
| 608 core.int buildCounterSliceInfo = 0; |
| 609 buildSliceInfo() { |
| 610 var o = new api.SliceInfo(); |
| 611 buildCounterSliceInfo++; |
| 612 if (buildCounterSliceInfo < 3) { |
| 613 o.duration = 42; |
| 614 o.kind = "foo"; |
| 615 o.segment = buildUnnamed13(); |
| 616 } |
| 617 buildCounterSliceInfo--; |
| 618 return o; |
| 619 } |
| 620 |
| 621 checkSliceInfo(api.SliceInfo o) { |
| 622 buildCounterSliceInfo++; |
| 623 if (buildCounterSliceInfo < 3) { |
| 624 unittest.expect(o.duration, unittest.equals(42)); |
| 625 unittest.expect(o.kind, unittest.equals('foo')); |
| 626 checkUnnamed13(o.segment); |
| 627 } |
| 628 buildCounterSliceInfo--; |
| 629 } |
| 630 |
| 631 buildUnnamed14() { |
| 632 var o = new core.List<core.String>(); |
| 633 o.add("foo"); |
| 634 o.add("foo"); |
| 635 return o; |
| 636 } |
| 637 |
| 638 checkUnnamed14(core.List<core.String> o) { |
| 639 unittest.expect(o, unittest.hasLength(2)); |
| 640 unittest.expect(o[0], unittest.equals('foo')); |
| 641 unittest.expect(o[1], unittest.equals('foo')); |
| 642 } |
| 643 |
| 644 buildUnnamed15() { |
| 645 var o = new core.List<core.String>(); |
| 646 o.add("foo"); |
| 647 o.add("foo"); |
| 648 return o; |
| 649 } |
| 650 |
| 651 checkUnnamed15(core.List<core.String> o) { |
| 652 unittest.expect(o, unittest.hasLength(2)); |
| 653 unittest.expect(o[0], unittest.equals('foo')); |
| 654 unittest.expect(o[1], unittest.equals('foo')); |
| 655 } |
| 656 |
| 657 core.int buildCounterSliceInput = 0; |
| 658 buildSliceInput() { |
| 659 var o = new api.SliceInput(); |
| 660 buildCounterSliceInput++; |
| 661 if (buildCounterSliceInput < 3) { |
| 662 o.alliance = "foo"; |
| 663 o.date = "foo"; |
| 664 o.destination = "foo"; |
| 665 o.kind = "foo"; |
| 666 o.maxConnectionDuration = 42; |
| 667 o.maxStops = 42; |
| 668 o.origin = "foo"; |
| 669 o.permittedCarrier = buildUnnamed14(); |
| 670 o.permittedDepartureTime = buildTimeOfDayRange(); |
| 671 o.preferredCabin = "foo"; |
| 672 o.prohibitedCarrier = buildUnnamed15(); |
| 673 } |
| 674 buildCounterSliceInput--; |
| 675 return o; |
| 676 } |
| 677 |
| 678 checkSliceInput(api.SliceInput o) { |
| 679 buildCounterSliceInput++; |
| 680 if (buildCounterSliceInput < 3) { |
| 681 unittest.expect(o.alliance, unittest.equals('foo')); |
| 682 unittest.expect(o.date, unittest.equals('foo')); |
| 683 unittest.expect(o.destination, unittest.equals('foo')); |
| 684 unittest.expect(o.kind, unittest.equals('foo')); |
| 685 unittest.expect(o.maxConnectionDuration, unittest.equals(42)); |
| 686 unittest.expect(o.maxStops, unittest.equals(42)); |
| 687 unittest.expect(o.origin, unittest.equals('foo')); |
| 688 checkUnnamed14(o.permittedCarrier); |
| 689 checkTimeOfDayRange(o.permittedDepartureTime); |
| 690 unittest.expect(o.preferredCabin, unittest.equals('foo')); |
| 691 checkUnnamed15(o.prohibitedCarrier); |
| 692 } |
| 693 buildCounterSliceInput--; |
| 694 } |
| 695 |
| 696 core.int buildCounterTaxData = 0; |
| 697 buildTaxData() { |
| 698 var o = new api.TaxData(); |
| 699 buildCounterTaxData++; |
| 700 if (buildCounterTaxData < 3) { |
| 701 o.id = "foo"; |
| 702 o.kind = "foo"; |
| 703 o.name = "foo"; |
| 704 } |
| 705 buildCounterTaxData--; |
| 706 return o; |
| 707 } |
| 708 |
| 709 checkTaxData(api.TaxData o) { |
| 710 buildCounterTaxData++; |
| 711 if (buildCounterTaxData < 3) { |
| 712 unittest.expect(o.id, unittest.equals('foo')); |
| 713 unittest.expect(o.kind, unittest.equals('foo')); |
| 714 unittest.expect(o.name, unittest.equals('foo')); |
| 715 } |
| 716 buildCounterTaxData--; |
| 717 } |
| 718 |
| 719 core.int buildCounterTaxInfo = 0; |
| 720 buildTaxInfo() { |
| 721 var o = new api.TaxInfo(); |
| 722 buildCounterTaxInfo++; |
| 723 if (buildCounterTaxInfo < 3) { |
| 724 o.chargeType = "foo"; |
| 725 o.code = "foo"; |
| 726 o.country = "foo"; |
| 727 o.id = "foo"; |
| 728 o.kind = "foo"; |
| 729 o.salePrice = "foo"; |
| 730 } |
| 731 buildCounterTaxInfo--; |
| 732 return o; |
| 733 } |
| 734 |
| 735 checkTaxInfo(api.TaxInfo o) { |
| 736 buildCounterTaxInfo++; |
| 737 if (buildCounterTaxInfo < 3) { |
| 738 unittest.expect(o.chargeType, unittest.equals('foo')); |
| 739 unittest.expect(o.code, unittest.equals('foo')); |
| 740 unittest.expect(o.country, unittest.equals('foo')); |
| 741 unittest.expect(o.id, unittest.equals('foo')); |
| 742 unittest.expect(o.kind, unittest.equals('foo')); |
| 743 unittest.expect(o.salePrice, unittest.equals('foo')); |
| 744 } |
| 745 buildCounterTaxInfo--; |
| 746 } |
| 747 |
| 748 core.int buildCounterTimeOfDayRange = 0; |
| 749 buildTimeOfDayRange() { |
| 750 var o = new api.TimeOfDayRange(); |
| 751 buildCounterTimeOfDayRange++; |
| 752 if (buildCounterTimeOfDayRange < 3) { |
| 753 o.earliestTime = "foo"; |
| 754 o.kind = "foo"; |
| 755 o.latestTime = "foo"; |
| 756 } |
| 757 buildCounterTimeOfDayRange--; |
| 758 return o; |
| 759 } |
| 760 |
| 761 checkTimeOfDayRange(api.TimeOfDayRange o) { |
| 762 buildCounterTimeOfDayRange++; |
| 763 if (buildCounterTimeOfDayRange < 3) { |
| 764 unittest.expect(o.earliestTime, unittest.equals('foo')); |
| 765 unittest.expect(o.kind, unittest.equals('foo')); |
| 766 unittest.expect(o.latestTime, unittest.equals('foo')); |
| 767 } |
| 768 buildCounterTimeOfDayRange--; |
| 769 } |
| 770 |
| 771 buildUnnamed16() { |
| 772 var o = new core.List<api.PricingInfo>(); |
| 773 o.add(buildPricingInfo()); |
| 774 o.add(buildPricingInfo()); |
| 775 return o; |
| 776 } |
| 777 |
| 778 checkUnnamed16(core.List<api.PricingInfo> o) { |
| 779 unittest.expect(o, unittest.hasLength(2)); |
| 780 checkPricingInfo(o[0]); |
| 781 checkPricingInfo(o[1]); |
| 782 } |
| 783 |
| 784 buildUnnamed17() { |
| 785 var o = new core.List<api.SliceInfo>(); |
| 786 o.add(buildSliceInfo()); |
| 787 o.add(buildSliceInfo()); |
| 788 return o; |
| 789 } |
| 790 |
| 791 checkUnnamed17(core.List<api.SliceInfo> o) { |
| 792 unittest.expect(o, unittest.hasLength(2)); |
| 793 checkSliceInfo(o[0]); |
| 794 checkSliceInfo(o[1]); |
| 795 } |
| 796 |
| 797 core.int buildCounterTripOption = 0; |
| 798 buildTripOption() { |
| 799 var o = new api.TripOption(); |
| 800 buildCounterTripOption++; |
| 801 if (buildCounterTripOption < 3) { |
| 802 o.id = "foo"; |
| 803 o.kind = "foo"; |
| 804 o.pricing = buildUnnamed16(); |
| 805 o.saleTotal = "foo"; |
| 806 o.slice = buildUnnamed17(); |
| 807 } |
| 808 buildCounterTripOption--; |
| 809 return o; |
| 810 } |
| 811 |
| 812 checkTripOption(api.TripOption o) { |
| 813 buildCounterTripOption++; |
| 814 if (buildCounterTripOption < 3) { |
| 815 unittest.expect(o.id, unittest.equals('foo')); |
| 816 unittest.expect(o.kind, unittest.equals('foo')); |
| 817 checkUnnamed16(o.pricing); |
| 818 unittest.expect(o.saleTotal, unittest.equals('foo')); |
| 819 checkUnnamed17(o.slice); |
| 820 } |
| 821 buildCounterTripOption--; |
| 822 } |
| 823 |
| 824 buildUnnamed18() { |
| 825 var o = new core.List<api.SliceInput>(); |
| 826 o.add(buildSliceInput()); |
| 827 o.add(buildSliceInput()); |
| 828 return o; |
| 829 } |
| 830 |
| 831 checkUnnamed18(core.List<api.SliceInput> o) { |
| 832 unittest.expect(o, unittest.hasLength(2)); |
| 833 checkSliceInput(o[0]); |
| 834 checkSliceInput(o[1]); |
| 835 } |
| 836 |
| 837 core.int buildCounterTripOptionsRequest = 0; |
| 838 buildTripOptionsRequest() { |
| 839 var o = new api.TripOptionsRequest(); |
| 840 buildCounterTripOptionsRequest++; |
| 841 if (buildCounterTripOptionsRequest < 3) { |
| 842 o.maxPrice = "foo"; |
| 843 o.passengers = buildPassengerCounts(); |
| 844 o.refundable = true; |
| 845 o.saleCountry = "foo"; |
| 846 o.slice = buildUnnamed18(); |
| 847 o.solutions = 42; |
| 848 } |
| 849 buildCounterTripOptionsRequest--; |
| 850 return o; |
| 851 } |
| 852 |
| 853 checkTripOptionsRequest(api.TripOptionsRequest o) { |
| 854 buildCounterTripOptionsRequest++; |
| 855 if (buildCounterTripOptionsRequest < 3) { |
| 856 unittest.expect(o.maxPrice, unittest.equals('foo')); |
| 857 checkPassengerCounts(o.passengers); |
| 858 unittest.expect(o.refundable, unittest.isTrue); |
| 859 unittest.expect(o.saleCountry, unittest.equals('foo')); |
| 860 checkUnnamed18(o.slice); |
| 861 unittest.expect(o.solutions, unittest.equals(42)); |
| 862 } |
| 863 buildCounterTripOptionsRequest--; |
| 864 } |
| 865 |
| 866 buildUnnamed19() { |
| 867 var o = new core.List<api.TripOption>(); |
| 868 o.add(buildTripOption()); |
| 869 o.add(buildTripOption()); |
| 870 return o; |
| 871 } |
| 872 |
| 873 checkUnnamed19(core.List<api.TripOption> o) { |
| 874 unittest.expect(o, unittest.hasLength(2)); |
| 875 checkTripOption(o[0]); |
| 876 checkTripOption(o[1]); |
| 877 } |
| 878 |
| 879 core.int buildCounterTripOptionsResponse = 0; |
| 880 buildTripOptionsResponse() { |
| 881 var o = new api.TripOptionsResponse(); |
| 882 buildCounterTripOptionsResponse++; |
| 883 if (buildCounterTripOptionsResponse < 3) { |
| 884 o.data = buildData(); |
| 885 o.kind = "foo"; |
| 886 o.requestId = "foo"; |
| 887 o.tripOption = buildUnnamed19(); |
| 888 } |
| 889 buildCounterTripOptionsResponse--; |
| 890 return o; |
| 891 } |
| 892 |
| 893 checkTripOptionsResponse(api.TripOptionsResponse o) { |
| 894 buildCounterTripOptionsResponse++; |
| 895 if (buildCounterTripOptionsResponse < 3) { |
| 896 checkData(o.data); |
| 897 unittest.expect(o.kind, unittest.equals('foo')); |
| 898 unittest.expect(o.requestId, unittest.equals('foo')); |
| 899 checkUnnamed19(o.tripOption); |
| 900 } |
| 901 buildCounterTripOptionsResponse--; |
| 902 } |
| 903 |
| 904 core.int buildCounterTripsSearchRequest = 0; |
| 905 buildTripsSearchRequest() { |
| 906 var o = new api.TripsSearchRequest(); |
| 907 buildCounterTripsSearchRequest++; |
| 908 if (buildCounterTripsSearchRequest < 3) { |
| 909 o.request = buildTripOptionsRequest(); |
| 910 } |
| 911 buildCounterTripsSearchRequest--; |
| 912 return o; |
| 913 } |
| 914 |
| 915 checkTripsSearchRequest(api.TripsSearchRequest o) { |
| 916 buildCounterTripsSearchRequest++; |
| 917 if (buildCounterTripsSearchRequest < 3) { |
| 918 checkTripOptionsRequest(o.request); |
| 919 } |
| 920 buildCounterTripsSearchRequest--; |
| 921 } |
| 922 |
| 923 core.int buildCounterTripsSearchResponse = 0; |
| 924 buildTripsSearchResponse() { |
| 925 var o = new api.TripsSearchResponse(); |
| 926 buildCounterTripsSearchResponse++; |
| 927 if (buildCounterTripsSearchResponse < 3) { |
| 928 o.kind = "foo"; |
| 929 o.trips = buildTripOptionsResponse(); |
| 930 } |
| 931 buildCounterTripsSearchResponse--; |
| 932 return o; |
| 933 } |
| 934 |
| 935 checkTripsSearchResponse(api.TripsSearchResponse o) { |
| 936 buildCounterTripsSearchResponse++; |
| 937 if (buildCounterTripsSearchResponse < 3) { |
| 938 unittest.expect(o.kind, unittest.equals('foo')); |
| 939 checkTripOptionsResponse(o.trips); |
| 940 } |
| 941 buildCounterTripsSearchResponse--; |
| 942 } |
| 943 |
| 944 |
| 945 main() { |
| 946 unittest.group("obj-schema-AircraftData", () { |
| 947 unittest.test("to-json--from-json", () { |
| 948 var o = buildAircraftData(); |
| 949 var od = new api.AircraftData.fromJson(o.toJson()); |
| 950 checkAircraftData(od); |
| 951 }); |
| 952 }); |
| 953 |
| 954 |
| 955 unittest.group("obj-schema-AirportData", () { |
| 956 unittest.test("to-json--from-json", () { |
| 957 var o = buildAirportData(); |
| 958 var od = new api.AirportData.fromJson(o.toJson()); |
| 959 checkAirportData(od); |
| 960 }); |
| 961 }); |
| 962 |
| 963 |
| 964 unittest.group("obj-schema-BagDescriptor", () { |
| 965 unittest.test("to-json--from-json", () { |
| 966 var o = buildBagDescriptor(); |
| 967 var od = new api.BagDescriptor.fromJson(o.toJson()); |
| 968 checkBagDescriptor(od); |
| 969 }); |
| 970 }); |
| 971 |
| 972 |
| 973 unittest.group("obj-schema-CarrierData", () { |
| 974 unittest.test("to-json--from-json", () { |
| 975 var o = buildCarrierData(); |
| 976 var od = new api.CarrierData.fromJson(o.toJson()); |
| 977 checkCarrierData(od); |
| 978 }); |
| 979 }); |
| 980 |
| 981 |
| 982 unittest.group("obj-schema-CityData", () { |
| 983 unittest.test("to-json--from-json", () { |
| 984 var o = buildCityData(); |
| 985 var od = new api.CityData.fromJson(o.toJson()); |
| 986 checkCityData(od); |
| 987 }); |
| 988 }); |
| 989 |
| 990 |
| 991 unittest.group("obj-schema-Data", () { |
| 992 unittest.test("to-json--from-json", () { |
| 993 var o = buildData(); |
| 994 var od = new api.Data.fromJson(o.toJson()); |
| 995 checkData(od); |
| 996 }); |
| 997 }); |
| 998 |
| 999 |
| 1000 unittest.group("obj-schema-FareInfo", () { |
| 1001 unittest.test("to-json--from-json", () { |
| 1002 var o = buildFareInfo(); |
| 1003 var od = new api.FareInfo.fromJson(o.toJson()); |
| 1004 checkFareInfo(od); |
| 1005 }); |
| 1006 }); |
| 1007 |
| 1008 |
| 1009 unittest.group("obj-schema-FlightInfo", () { |
| 1010 unittest.test("to-json--from-json", () { |
| 1011 var o = buildFlightInfo(); |
| 1012 var od = new api.FlightInfo.fromJson(o.toJson()); |
| 1013 checkFlightInfo(od); |
| 1014 }); |
| 1015 }); |
| 1016 |
| 1017 |
| 1018 unittest.group("obj-schema-FreeBaggageAllowance", () { |
| 1019 unittest.test("to-json--from-json", () { |
| 1020 var o = buildFreeBaggageAllowance(); |
| 1021 var od = new api.FreeBaggageAllowance.fromJson(o.toJson()); |
| 1022 checkFreeBaggageAllowance(od); |
| 1023 }); |
| 1024 }); |
| 1025 |
| 1026 |
| 1027 unittest.group("obj-schema-LegInfo", () { |
| 1028 unittest.test("to-json--from-json", () { |
| 1029 var o = buildLegInfo(); |
| 1030 var od = new api.LegInfo.fromJson(o.toJson()); |
| 1031 checkLegInfo(od); |
| 1032 }); |
| 1033 }); |
| 1034 |
| 1035 |
| 1036 unittest.group("obj-schema-PassengerCounts", () { |
| 1037 unittest.test("to-json--from-json", () { |
| 1038 var o = buildPassengerCounts(); |
| 1039 var od = new api.PassengerCounts.fromJson(o.toJson()); |
| 1040 checkPassengerCounts(od); |
| 1041 }); |
| 1042 }); |
| 1043 |
| 1044 |
| 1045 unittest.group("obj-schema-PricingInfo", () { |
| 1046 unittest.test("to-json--from-json", () { |
| 1047 var o = buildPricingInfo(); |
| 1048 var od = new api.PricingInfo.fromJson(o.toJson()); |
| 1049 checkPricingInfo(od); |
| 1050 }); |
| 1051 }); |
| 1052 |
| 1053 |
| 1054 unittest.group("obj-schema-SegmentInfo", () { |
| 1055 unittest.test("to-json--from-json", () { |
| 1056 var o = buildSegmentInfo(); |
| 1057 var od = new api.SegmentInfo.fromJson(o.toJson()); |
| 1058 checkSegmentInfo(od); |
| 1059 }); |
| 1060 }); |
| 1061 |
| 1062 |
| 1063 unittest.group("obj-schema-SegmentPricing", () { |
| 1064 unittest.test("to-json--from-json", () { |
| 1065 var o = buildSegmentPricing(); |
| 1066 var od = new api.SegmentPricing.fromJson(o.toJson()); |
| 1067 checkSegmentPricing(od); |
| 1068 }); |
| 1069 }); |
| 1070 |
| 1071 |
| 1072 unittest.group("obj-schema-SliceInfo", () { |
| 1073 unittest.test("to-json--from-json", () { |
| 1074 var o = buildSliceInfo(); |
| 1075 var od = new api.SliceInfo.fromJson(o.toJson()); |
| 1076 checkSliceInfo(od); |
| 1077 }); |
| 1078 }); |
| 1079 |
| 1080 |
| 1081 unittest.group("obj-schema-SliceInput", () { |
| 1082 unittest.test("to-json--from-json", () { |
| 1083 var o = buildSliceInput(); |
| 1084 var od = new api.SliceInput.fromJson(o.toJson()); |
| 1085 checkSliceInput(od); |
| 1086 }); |
| 1087 }); |
| 1088 |
| 1089 |
| 1090 unittest.group("obj-schema-TaxData", () { |
| 1091 unittest.test("to-json--from-json", () { |
| 1092 var o = buildTaxData(); |
| 1093 var od = new api.TaxData.fromJson(o.toJson()); |
| 1094 checkTaxData(od); |
| 1095 }); |
| 1096 }); |
| 1097 |
| 1098 |
| 1099 unittest.group("obj-schema-TaxInfo", () { |
| 1100 unittest.test("to-json--from-json", () { |
| 1101 var o = buildTaxInfo(); |
| 1102 var od = new api.TaxInfo.fromJson(o.toJson()); |
| 1103 checkTaxInfo(od); |
| 1104 }); |
| 1105 }); |
| 1106 |
| 1107 |
| 1108 unittest.group("obj-schema-TimeOfDayRange", () { |
| 1109 unittest.test("to-json--from-json", () { |
| 1110 var o = buildTimeOfDayRange(); |
| 1111 var od = new api.TimeOfDayRange.fromJson(o.toJson()); |
| 1112 checkTimeOfDayRange(od); |
| 1113 }); |
| 1114 }); |
| 1115 |
| 1116 |
| 1117 unittest.group("obj-schema-TripOption", () { |
| 1118 unittest.test("to-json--from-json", () { |
| 1119 var o = buildTripOption(); |
| 1120 var od = new api.TripOption.fromJson(o.toJson()); |
| 1121 checkTripOption(od); |
| 1122 }); |
| 1123 }); |
| 1124 |
| 1125 |
| 1126 unittest.group("obj-schema-TripOptionsRequest", () { |
| 1127 unittest.test("to-json--from-json", () { |
| 1128 var o = buildTripOptionsRequest(); |
| 1129 var od = new api.TripOptionsRequest.fromJson(o.toJson()); |
| 1130 checkTripOptionsRequest(od); |
| 1131 }); |
| 1132 }); |
| 1133 |
| 1134 |
| 1135 unittest.group("obj-schema-TripOptionsResponse", () { |
| 1136 unittest.test("to-json--from-json", () { |
| 1137 var o = buildTripOptionsResponse(); |
| 1138 var od = new api.TripOptionsResponse.fromJson(o.toJson()); |
| 1139 checkTripOptionsResponse(od); |
| 1140 }); |
| 1141 }); |
| 1142 |
| 1143 |
| 1144 unittest.group("obj-schema-TripsSearchRequest", () { |
| 1145 unittest.test("to-json--from-json", () { |
| 1146 var o = buildTripsSearchRequest(); |
| 1147 var od = new api.TripsSearchRequest.fromJson(o.toJson()); |
| 1148 checkTripsSearchRequest(od); |
| 1149 }); |
| 1150 }); |
| 1151 |
| 1152 |
| 1153 unittest.group("obj-schema-TripsSearchResponse", () { |
| 1154 unittest.test("to-json--from-json", () { |
| 1155 var o = buildTripsSearchResponse(); |
| 1156 var od = new api.TripsSearchResponse.fromJson(o.toJson()); |
| 1157 checkTripsSearchResponse(od); |
| 1158 }); |
| 1159 }); |
| 1160 |
| 1161 |
| 1162 unittest.group("resource-TripsResourceApi", () { |
| 1163 unittest.test("method--search", () { |
| 1164 |
| 1165 var mock = new common_test.HttpServerMock(); |
| 1166 api.TripsResourceApi res = new api.QpxExpressApi(mock).trips; |
| 1167 var arg_request = buildTripsSearchRequest(); |
| 1168 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1169 var obj = new api.TripsSearchRequest.fromJson(json); |
| 1170 checkTripsSearchRequest(obj); |
| 1171 |
| 1172 var path = (req.url).path; |
| 1173 var pathOffset = 0; |
| 1174 var index; |
| 1175 var subPart; |
| 1176 unittest.expect(path.substring(pathOffset, pathOffset + 21), unittest.eq
uals("/qpxExpress/v1/trips/")); |
| 1177 pathOffset += 21; |
| 1178 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("search")); |
| 1179 pathOffset += 6; |
| 1180 |
| 1181 var query = (req.url).query; |
| 1182 var queryOffset = 0; |
| 1183 var queryMap = {}; |
| 1184 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1185 parseBool(n) { |
| 1186 if (n == "true") return true; |
| 1187 if (n == "false") return false; |
| 1188 if (n == null) return null; |
| 1189 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1190 } |
| 1191 if (query.length > 0) { |
| 1192 for (var part in query.split("&")) { |
| 1193 var keyvalue = part.split("="); |
| 1194 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1195 } |
| 1196 } |
| 1197 |
| 1198 |
| 1199 var h = { |
| 1200 "content-type" : "application/json; charset=utf-8", |
| 1201 }; |
| 1202 var resp = convert.JSON.encode(buildTripsSearchResponse()); |
| 1203 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 1204 }), true); |
| 1205 res.search(arg_request).then(unittest.expectAsync(((api.TripsSearchRespons
e response) { |
| 1206 checkTripsSearchResponse(response); |
| 1207 }))); |
| 1208 }); |
| 1209 |
| 1210 }); |
| 1211 |
| 1212 |
| 1213 } |
| 1214 |
OLD | NEW |