OLD | NEW |
1 library googleapis.playmoviespartner.v1.test; | 1 library googleapis.playmoviespartner.v1.test; |
2 | 2 |
3 import "dart:core" as core; | 3 import "dart:core" as core; |
4 import "dart:collection" as collection; | 4 import "dart:collection" as collection; |
5 import "dart:async" as async; | 5 import "dart:async" as async; |
6 import "dart:convert" as convert; | 6 import "dart:convert" as convert; |
7 | 7 |
8 import 'package:http/http.dart' as http; | 8 import 'package:http/http.dart' as http; |
9 import 'package:http/testing.dart' as http_testing; | 9 import 'package:http/testing.dart' as http_testing; |
10 import 'package:unittest/unittest.dart' as unittest; | 10 import 'package:unittest/unittest.dart' as unittest; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 } | 44 } |
45 } | 45 } |
46 } | 46 } |
47 | 47 |
48 http.StreamedResponse stringResponse( | 48 http.StreamedResponse stringResponse( |
49 core.int status, core.Map headers, core.String body) { | 49 core.int status, core.Map headers, core.String body) { |
50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); | 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
51 return new http.StreamedResponse(stream, status, headers: headers); | 51 return new http.StreamedResponse(stream, status, headers: headers); |
52 } | 52 } |
53 | 53 |
| 54 buildUnnamed2275() { |
| 55 var o = new core.List<core.String>(); |
| 56 o.add("foo"); |
| 57 o.add("foo"); |
| 58 return o; |
| 59 } |
| 60 |
| 61 checkUnnamed2275(core.List<core.String> o) { |
| 62 unittest.expect(o, unittest.hasLength(2)); |
| 63 unittest.expect(o[0], unittest.equals('foo')); |
| 64 unittest.expect(o[1], unittest.equals('foo')); |
| 65 } |
| 66 |
| 67 core.int buildCounterAvail = 0; |
| 68 buildAvail() { |
| 69 var o = new api.Avail(); |
| 70 buildCounterAvail++; |
| 71 if (buildCounterAvail < 3) { |
| 72 o.altId = "foo"; |
| 73 o.captionExemption = "foo"; |
| 74 o.captionIncluded = true; |
| 75 o.contentId = "foo"; |
| 76 o.displayName = "foo"; |
| 77 o.encodeId = "foo"; |
| 78 o.end = "foo"; |
| 79 o.episodeAltId = "foo"; |
| 80 o.episodeNumber = "foo"; |
| 81 o.episodeTitleInternalAlias = "foo"; |
| 82 o.formatProfile = "foo"; |
| 83 o.licenseType = "foo"; |
| 84 o.pphNames = buildUnnamed2275(); |
| 85 o.priceType = "foo"; |
| 86 o.priceValue = "foo"; |
| 87 o.productId = "foo"; |
| 88 o.ratingReason = "foo"; |
| 89 o.ratingSystem = "foo"; |
| 90 o.ratingValue = "foo"; |
| 91 o.releaseDate = "foo"; |
| 92 o.seasonAltId = "foo"; |
| 93 o.seasonNumber = "foo"; |
| 94 o.seasonTitleInternalAlias = "foo"; |
| 95 o.seriesAltId = "foo"; |
| 96 o.seriesTitleInternalAlias = "foo"; |
| 97 o.start = "foo"; |
| 98 o.storeLanguage = "foo"; |
| 99 o.suppressionLiftDate = "foo"; |
| 100 o.territory = "foo"; |
| 101 o.titleInternalAlias = "foo"; |
| 102 o.videoId = "foo"; |
| 103 o.workType = "foo"; |
| 104 } |
| 105 buildCounterAvail--; |
| 106 return o; |
| 107 } |
| 108 |
| 109 checkAvail(api.Avail o) { |
| 110 buildCounterAvail++; |
| 111 if (buildCounterAvail < 3) { |
| 112 unittest.expect(o.altId, unittest.equals('foo')); |
| 113 unittest.expect(o.captionExemption, unittest.equals('foo')); |
| 114 unittest.expect(o.captionIncluded, unittest.isTrue); |
| 115 unittest.expect(o.contentId, unittest.equals('foo')); |
| 116 unittest.expect(o.displayName, unittest.equals('foo')); |
| 117 unittest.expect(o.encodeId, unittest.equals('foo')); |
| 118 unittest.expect(o.end, unittest.equals('foo')); |
| 119 unittest.expect(o.episodeAltId, unittest.equals('foo')); |
| 120 unittest.expect(o.episodeNumber, unittest.equals('foo')); |
| 121 unittest.expect(o.episodeTitleInternalAlias, unittest.equals('foo')); |
| 122 unittest.expect(o.formatProfile, unittest.equals('foo')); |
| 123 unittest.expect(o.licenseType, unittest.equals('foo')); |
| 124 checkUnnamed2275(o.pphNames); |
| 125 unittest.expect(o.priceType, unittest.equals('foo')); |
| 126 unittest.expect(o.priceValue, unittest.equals('foo')); |
| 127 unittest.expect(o.productId, unittest.equals('foo')); |
| 128 unittest.expect(o.ratingReason, unittest.equals('foo')); |
| 129 unittest.expect(o.ratingSystem, unittest.equals('foo')); |
| 130 unittest.expect(o.ratingValue, unittest.equals('foo')); |
| 131 unittest.expect(o.releaseDate, unittest.equals('foo')); |
| 132 unittest.expect(o.seasonAltId, unittest.equals('foo')); |
| 133 unittest.expect(o.seasonNumber, unittest.equals('foo')); |
| 134 unittest.expect(o.seasonTitleInternalAlias, unittest.equals('foo')); |
| 135 unittest.expect(o.seriesAltId, unittest.equals('foo')); |
| 136 unittest.expect(o.seriesTitleInternalAlias, unittest.equals('foo')); |
| 137 unittest.expect(o.start, unittest.equals('foo')); |
| 138 unittest.expect(o.storeLanguage, unittest.equals('foo')); |
| 139 unittest.expect(o.suppressionLiftDate, unittest.equals('foo')); |
| 140 unittest.expect(o.territory, unittest.equals('foo')); |
| 141 unittest.expect(o.titleInternalAlias, unittest.equals('foo')); |
| 142 unittest.expect(o.videoId, unittest.equals('foo')); |
| 143 unittest.expect(o.workType, unittest.equals('foo')); |
| 144 } |
| 145 buildCounterAvail--; |
| 146 } |
| 147 |
| 148 buildUnnamed2276() { |
| 149 var o = new core.List<core.String>(); |
| 150 o.add("foo"); |
| 151 o.add("foo"); |
| 152 return o; |
| 153 } |
| 154 |
| 155 checkUnnamed2276(core.List<core.String> o) { |
| 156 unittest.expect(o, unittest.hasLength(2)); |
| 157 unittest.expect(o[0], unittest.equals('foo')); |
| 158 unittest.expect(o[1], unittest.equals('foo')); |
| 159 } |
| 160 |
| 161 buildUnnamed2277() { |
| 162 var o = new core.List<core.String>(); |
| 163 o.add("foo"); |
| 164 o.add("foo"); |
| 165 return o; |
| 166 } |
| 167 |
| 168 checkUnnamed2277(core.List<core.String> o) { |
| 169 unittest.expect(o, unittest.hasLength(2)); |
| 170 unittest.expect(o[0], unittest.equals('foo')); |
| 171 unittest.expect(o[1], unittest.equals('foo')); |
| 172 } |
| 173 |
| 174 core.int buildCounterExperienceLocale = 0; |
| 175 buildExperienceLocale() { |
| 176 var o = new api.ExperienceLocale(); |
| 177 buildCounterExperienceLocale++; |
| 178 if (buildCounterExperienceLocale < 3) { |
| 179 o.altCutId = "foo"; |
| 180 o.approvedTime = "foo"; |
| 181 o.channelId = "foo"; |
| 182 o.country = "foo"; |
| 183 o.createdTime = "foo"; |
| 184 o.customIds = buildUnnamed2276(); |
| 185 o.earliestAvailStartTime = "foo"; |
| 186 o.editLevelEidr = "foo"; |
| 187 o.elId = "foo"; |
| 188 o.inventoryId = "foo"; |
| 189 o.language = "foo"; |
| 190 o.name = "foo"; |
| 191 o.normalizedPriority = "foo"; |
| 192 o.playableSequenceId = "foo"; |
| 193 o.pphNames = buildUnnamed2277(); |
| 194 o.presentationId = "foo"; |
| 195 o.priority = 42.0; |
| 196 o.status = "foo"; |
| 197 o.studioName = "foo"; |
| 198 o.titleLevelEidr = "foo"; |
| 199 o.trailerId = "foo"; |
| 200 o.type = "foo"; |
| 201 o.videoId = "foo"; |
| 202 } |
| 203 buildCounterExperienceLocale--; |
| 204 return o; |
| 205 } |
| 206 |
| 207 checkExperienceLocale(api.ExperienceLocale o) { |
| 208 buildCounterExperienceLocale++; |
| 209 if (buildCounterExperienceLocale < 3) { |
| 210 unittest.expect(o.altCutId, unittest.equals('foo')); |
| 211 unittest.expect(o.approvedTime, unittest.equals('foo')); |
| 212 unittest.expect(o.channelId, unittest.equals('foo')); |
| 213 unittest.expect(o.country, unittest.equals('foo')); |
| 214 unittest.expect(o.createdTime, unittest.equals('foo')); |
| 215 checkUnnamed2276(o.customIds); |
| 216 unittest.expect(o.earliestAvailStartTime, unittest.equals('foo')); |
| 217 unittest.expect(o.editLevelEidr, unittest.equals('foo')); |
| 218 unittest.expect(o.elId, unittest.equals('foo')); |
| 219 unittest.expect(o.inventoryId, unittest.equals('foo')); |
| 220 unittest.expect(o.language, unittest.equals('foo')); |
| 221 unittest.expect(o.name, unittest.equals('foo')); |
| 222 unittest.expect(o.normalizedPriority, unittest.equals('foo')); |
| 223 unittest.expect(o.playableSequenceId, unittest.equals('foo')); |
| 224 checkUnnamed2277(o.pphNames); |
| 225 unittest.expect(o.presentationId, unittest.equals('foo')); |
| 226 unittest.expect(o.priority, unittest.equals(42.0)); |
| 227 unittest.expect(o.status, unittest.equals('foo')); |
| 228 unittest.expect(o.studioName, unittest.equals('foo')); |
| 229 unittest.expect(o.titleLevelEidr, unittest.equals('foo')); |
| 230 unittest.expect(o.trailerId, unittest.equals('foo')); |
| 231 unittest.expect(o.type, unittest.equals('foo')); |
| 232 unittest.expect(o.videoId, unittest.equals('foo')); |
| 233 } |
| 234 buildCounterExperienceLocale--; |
| 235 } |
| 236 |
| 237 buildUnnamed2278() { |
| 238 var o = new core.List<api.Avail>(); |
| 239 o.add(buildAvail()); |
| 240 o.add(buildAvail()); |
| 241 return o; |
| 242 } |
| 243 |
| 244 checkUnnamed2278(core.List<api.Avail> o) { |
| 245 unittest.expect(o, unittest.hasLength(2)); |
| 246 checkAvail(o[0]); |
| 247 checkAvail(o[1]); |
| 248 } |
| 249 |
| 250 core.int buildCounterListAvailsResponse = 0; |
| 251 buildListAvailsResponse() { |
| 252 var o = new api.ListAvailsResponse(); |
| 253 buildCounterListAvailsResponse++; |
| 254 if (buildCounterListAvailsResponse < 3) { |
| 255 o.avails = buildUnnamed2278(); |
| 256 o.nextPageToken = "foo"; |
| 257 } |
| 258 buildCounterListAvailsResponse--; |
| 259 return o; |
| 260 } |
| 261 |
| 262 checkListAvailsResponse(api.ListAvailsResponse o) { |
| 263 buildCounterListAvailsResponse++; |
| 264 if (buildCounterListAvailsResponse < 3) { |
| 265 checkUnnamed2278(o.avails); |
| 266 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 267 } |
| 268 buildCounterListAvailsResponse--; |
| 269 } |
| 270 |
| 271 buildUnnamed2279() { |
| 272 var o = new core.List<api.ExperienceLocale>(); |
| 273 o.add(buildExperienceLocale()); |
| 274 o.add(buildExperienceLocale()); |
| 275 return o; |
| 276 } |
| 277 |
| 278 checkUnnamed2279(core.List<api.ExperienceLocale> o) { |
| 279 unittest.expect(o, unittest.hasLength(2)); |
| 280 checkExperienceLocale(o[0]); |
| 281 checkExperienceLocale(o[1]); |
| 282 } |
| 283 |
| 284 core.int buildCounterListExperienceLocalesResponse = 0; |
| 285 buildListExperienceLocalesResponse() { |
| 286 var o = new api.ListExperienceLocalesResponse(); |
| 287 buildCounterListExperienceLocalesResponse++; |
| 288 if (buildCounterListExperienceLocalesResponse < 3) { |
| 289 o.experienceLocales = buildUnnamed2279(); |
| 290 o.nextPageToken = "foo"; |
| 291 } |
| 292 buildCounterListExperienceLocalesResponse--; |
| 293 return o; |
| 294 } |
| 295 |
| 296 checkListExperienceLocalesResponse(api.ListExperienceLocalesResponse o) { |
| 297 buildCounterListExperienceLocalesResponse++; |
| 298 if (buildCounterListExperienceLocalesResponse < 3) { |
| 299 checkUnnamed2279(o.experienceLocales); |
| 300 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 301 } |
| 302 buildCounterListExperienceLocalesResponse--; |
| 303 } |
| 304 |
| 305 buildUnnamed2280() { |
| 306 var o = new core.List<api.Order>(); |
| 307 o.add(buildOrder()); |
| 308 o.add(buildOrder()); |
| 309 return o; |
| 310 } |
| 311 |
| 312 checkUnnamed2280(core.List<api.Order> o) { |
| 313 unittest.expect(o, unittest.hasLength(2)); |
| 314 checkOrder(o[0]); |
| 315 checkOrder(o[1]); |
| 316 } |
| 317 |
| 318 core.int buildCounterListOrdersResponse = 0; |
| 319 buildListOrdersResponse() { |
| 320 var o = new api.ListOrdersResponse(); |
| 321 buildCounterListOrdersResponse++; |
| 322 if (buildCounterListOrdersResponse < 3) { |
| 323 o.nextPageToken = "foo"; |
| 324 o.orders = buildUnnamed2280(); |
| 325 } |
| 326 buildCounterListOrdersResponse--; |
| 327 return o; |
| 328 } |
| 329 |
| 330 checkListOrdersResponse(api.ListOrdersResponse o) { |
| 331 buildCounterListOrdersResponse++; |
| 332 if (buildCounterListOrdersResponse < 3) { |
| 333 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 334 checkUnnamed2280(o.orders); |
| 335 } |
| 336 buildCounterListOrdersResponse--; |
| 337 } |
| 338 |
| 339 buildUnnamed2281() { |
| 340 var o = new core.List<api.StoreInfo>(); |
| 341 o.add(buildStoreInfo()); |
| 342 o.add(buildStoreInfo()); |
| 343 return o; |
| 344 } |
| 345 |
| 346 checkUnnamed2281(core.List<api.StoreInfo> o) { |
| 347 unittest.expect(o, unittest.hasLength(2)); |
| 348 checkStoreInfo(o[0]); |
| 349 checkStoreInfo(o[1]); |
| 350 } |
| 351 |
| 352 core.int buildCounterListStoreInfosResponse = 0; |
| 353 buildListStoreInfosResponse() { |
| 354 var o = new api.ListStoreInfosResponse(); |
| 355 buildCounterListStoreInfosResponse++; |
| 356 if (buildCounterListStoreInfosResponse < 3) { |
| 357 o.nextPageToken = "foo"; |
| 358 o.storeInfos = buildUnnamed2281(); |
| 359 } |
| 360 buildCounterListStoreInfosResponse--; |
| 361 return o; |
| 362 } |
| 363 |
| 364 checkListStoreInfosResponse(api.ListStoreInfosResponse o) { |
| 365 buildCounterListStoreInfosResponse++; |
| 366 if (buildCounterListStoreInfosResponse < 3) { |
| 367 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 368 checkUnnamed2281(o.storeInfos); |
| 369 } |
| 370 buildCounterListStoreInfosResponse--; |
| 371 } |
| 372 |
| 373 buildUnnamed2282() { |
| 374 var o = new core.List<core.String>(); |
| 375 o.add("foo"); |
| 376 o.add("foo"); |
| 377 return o; |
| 378 } |
| 379 |
| 380 checkUnnamed2282(core.List<core.String> o) { |
| 381 unittest.expect(o, unittest.hasLength(2)); |
| 382 unittest.expect(o[0], unittest.equals('foo')); |
| 383 unittest.expect(o[1], unittest.equals('foo')); |
| 384 } |
| 385 |
| 386 core.int buildCounterOrder = 0; |
| 387 buildOrder() { |
| 388 var o = new api.Order(); |
| 389 buildCounterOrder++; |
| 390 if (buildCounterOrder < 3) { |
| 391 o.approvedTime = "foo"; |
| 392 o.channelId = "foo"; |
| 393 o.channelName = "foo"; |
| 394 o.countries = buildUnnamed2282(); |
| 395 o.customId = "foo"; |
| 396 o.earliestAvailStartTime = "foo"; |
| 397 o.episodeName = "foo"; |
| 398 o.legacyPriority = "foo"; |
| 399 o.name = "foo"; |
| 400 o.normalizedPriority = "foo"; |
| 401 o.orderId = "foo"; |
| 402 o.orderedTime = "foo"; |
| 403 o.pphName = "foo"; |
| 404 o.priority = 42.0; |
| 405 o.receivedTime = "foo"; |
| 406 o.rejectionNote = "foo"; |
| 407 o.seasonName = "foo"; |
| 408 o.showName = "foo"; |
| 409 o.status = "foo"; |
| 410 o.statusDetail = "foo"; |
| 411 o.studioName = "foo"; |
| 412 o.type = "foo"; |
| 413 o.videoId = "foo"; |
| 414 } |
| 415 buildCounterOrder--; |
| 416 return o; |
| 417 } |
| 418 |
| 419 checkOrder(api.Order o) { |
| 420 buildCounterOrder++; |
| 421 if (buildCounterOrder < 3) { |
| 422 unittest.expect(o.approvedTime, unittest.equals('foo')); |
| 423 unittest.expect(o.channelId, unittest.equals('foo')); |
| 424 unittest.expect(o.channelName, unittest.equals('foo')); |
| 425 checkUnnamed2282(o.countries); |
| 426 unittest.expect(o.customId, unittest.equals('foo')); |
| 427 unittest.expect(o.earliestAvailStartTime, unittest.equals('foo')); |
| 428 unittest.expect(o.episodeName, unittest.equals('foo')); |
| 429 unittest.expect(o.legacyPriority, unittest.equals('foo')); |
| 430 unittest.expect(o.name, unittest.equals('foo')); |
| 431 unittest.expect(o.normalizedPriority, unittest.equals('foo')); |
| 432 unittest.expect(o.orderId, unittest.equals('foo')); |
| 433 unittest.expect(o.orderedTime, unittest.equals('foo')); |
| 434 unittest.expect(o.pphName, unittest.equals('foo')); |
| 435 unittest.expect(o.priority, unittest.equals(42.0)); |
| 436 unittest.expect(o.receivedTime, unittest.equals('foo')); |
| 437 unittest.expect(o.rejectionNote, unittest.equals('foo')); |
| 438 unittest.expect(o.seasonName, unittest.equals('foo')); |
| 439 unittest.expect(o.showName, unittest.equals('foo')); |
| 440 unittest.expect(o.status, unittest.equals('foo')); |
| 441 unittest.expect(o.statusDetail, unittest.equals('foo')); |
| 442 unittest.expect(o.studioName, unittest.equals('foo')); |
| 443 unittest.expect(o.type, unittest.equals('foo')); |
| 444 unittest.expect(o.videoId, unittest.equals('foo')); |
| 445 } |
| 446 buildCounterOrder--; |
| 447 } |
| 448 |
| 449 buildUnnamed2283() { |
| 450 var o = new core.List<core.String>(); |
| 451 o.add("foo"); |
| 452 o.add("foo"); |
| 453 return o; |
| 454 } |
| 455 |
| 456 checkUnnamed2283(core.List<core.String> o) { |
| 457 unittest.expect(o, unittest.hasLength(2)); |
| 458 unittest.expect(o[0], unittest.equals('foo')); |
| 459 unittest.expect(o[1], unittest.equals('foo')); |
| 460 } |
| 461 |
| 462 buildUnnamed2284() { |
| 463 var o = new core.List<core.String>(); |
| 464 o.add("foo"); |
| 465 o.add("foo"); |
| 466 return o; |
| 467 } |
| 468 |
| 469 checkUnnamed2284(core.List<core.String> o) { |
| 470 unittest.expect(o, unittest.hasLength(2)); |
| 471 unittest.expect(o[0], unittest.equals('foo')); |
| 472 unittest.expect(o[1], unittest.equals('foo')); |
| 473 } |
| 474 |
| 475 buildUnnamed2285() { |
| 476 var o = new core.List<core.String>(); |
| 477 o.add("foo"); |
| 478 o.add("foo"); |
| 479 return o; |
| 480 } |
| 481 |
| 482 checkUnnamed2285(core.List<core.String> o) { |
| 483 unittest.expect(o, unittest.hasLength(2)); |
| 484 unittest.expect(o[0], unittest.equals('foo')); |
| 485 unittest.expect(o[1], unittest.equals('foo')); |
| 486 } |
| 487 |
| 488 core.int buildCounterStoreInfo = 0; |
| 489 buildStoreInfo() { |
| 490 var o = new api.StoreInfo(); |
| 491 buildCounterStoreInfo++; |
| 492 if (buildCounterStoreInfo < 3) { |
| 493 o.audioTracks = buildUnnamed2283(); |
| 494 o.country = "foo"; |
| 495 o.editLevelEidr = "foo"; |
| 496 o.episodeNumber = "foo"; |
| 497 o.hasAudio51 = true; |
| 498 o.hasEstOffer = true; |
| 499 o.hasHdOffer = true; |
| 500 o.hasInfoCards = true; |
| 501 o.hasSdOffer = true; |
| 502 o.hasVodOffer = true; |
| 503 o.liveTime = "foo"; |
| 504 o.mid = "foo"; |
| 505 o.name = "foo"; |
| 506 o.pphNames = buildUnnamed2284(); |
| 507 o.seasonId = "foo"; |
| 508 o.seasonName = "foo"; |
| 509 o.seasonNumber = "foo"; |
| 510 o.showId = "foo"; |
| 511 o.showName = "foo"; |
| 512 o.studioName = "foo"; |
| 513 o.subtitles = buildUnnamed2285(); |
| 514 o.titleLevelEidr = "foo"; |
| 515 o.trailerId = "foo"; |
| 516 o.type = "foo"; |
| 517 o.videoId = "foo"; |
| 518 } |
| 519 buildCounterStoreInfo--; |
| 520 return o; |
| 521 } |
| 522 |
| 523 checkStoreInfo(api.StoreInfo o) { |
| 524 buildCounterStoreInfo++; |
| 525 if (buildCounterStoreInfo < 3) { |
| 526 checkUnnamed2283(o.audioTracks); |
| 527 unittest.expect(o.country, unittest.equals('foo')); |
| 528 unittest.expect(o.editLevelEidr, unittest.equals('foo')); |
| 529 unittest.expect(o.episodeNumber, unittest.equals('foo')); |
| 530 unittest.expect(o.hasAudio51, unittest.isTrue); |
| 531 unittest.expect(o.hasEstOffer, unittest.isTrue); |
| 532 unittest.expect(o.hasHdOffer, unittest.isTrue); |
| 533 unittest.expect(o.hasInfoCards, unittest.isTrue); |
| 534 unittest.expect(o.hasSdOffer, unittest.isTrue); |
| 535 unittest.expect(o.hasVodOffer, unittest.isTrue); |
| 536 unittest.expect(o.liveTime, unittest.equals('foo')); |
| 537 unittest.expect(o.mid, unittest.equals('foo')); |
| 538 unittest.expect(o.name, unittest.equals('foo')); |
| 539 checkUnnamed2284(o.pphNames); |
| 540 unittest.expect(o.seasonId, unittest.equals('foo')); |
| 541 unittest.expect(o.seasonName, unittest.equals('foo')); |
| 542 unittest.expect(o.seasonNumber, unittest.equals('foo')); |
| 543 unittest.expect(o.showId, unittest.equals('foo')); |
| 544 unittest.expect(o.showName, unittest.equals('foo')); |
| 545 unittest.expect(o.studioName, unittest.equals('foo')); |
| 546 checkUnnamed2285(o.subtitles); |
| 547 unittest.expect(o.titleLevelEidr, unittest.equals('foo')); |
| 548 unittest.expect(o.trailerId, unittest.equals('foo')); |
| 549 unittest.expect(o.type, unittest.equals('foo')); |
| 550 unittest.expect(o.videoId, unittest.equals('foo')); |
| 551 } |
| 552 buildCounterStoreInfo--; |
| 553 } |
| 554 |
| 555 buildUnnamed2286() { |
| 556 var o = new core.List<core.String>(); |
| 557 o.add("foo"); |
| 558 o.add("foo"); |
| 559 return o; |
| 560 } |
| 561 |
| 562 checkUnnamed2286(core.List<core.String> o) { |
| 563 unittest.expect(o, unittest.hasLength(2)); |
| 564 unittest.expect(o[0], unittest.equals('foo')); |
| 565 unittest.expect(o[1], unittest.equals('foo')); |
| 566 } |
| 567 |
| 568 buildUnnamed2287() { |
| 569 var o = new core.List<core.String>(); |
| 570 o.add("foo"); |
| 571 o.add("foo"); |
| 572 return o; |
| 573 } |
| 574 |
| 575 checkUnnamed2287(core.List<core.String> o) { |
| 576 unittest.expect(o, unittest.hasLength(2)); |
| 577 unittest.expect(o[0], unittest.equals('foo')); |
| 578 unittest.expect(o[1], unittest.equals('foo')); |
| 579 } |
| 580 |
| 581 buildUnnamed2288() { |
| 582 var o = new core.List<core.String>(); |
| 583 o.add("foo"); |
| 584 o.add("foo"); |
| 585 return o; |
| 586 } |
| 587 |
| 588 checkUnnamed2288(core.List<core.String> o) { |
| 589 unittest.expect(o, unittest.hasLength(2)); |
| 590 unittest.expect(o[0], unittest.equals('foo')); |
| 591 unittest.expect(o[1], unittest.equals('foo')); |
| 592 } |
| 593 |
| 594 buildUnnamed2289() { |
| 595 var o = new core.List<core.String>(); |
| 596 o.add("foo"); |
| 597 o.add("foo"); |
| 598 return o; |
| 599 } |
| 600 |
| 601 checkUnnamed2289(core.List<core.String> o) { |
| 602 unittest.expect(o, unittest.hasLength(2)); |
| 603 unittest.expect(o[0], unittest.equals('foo')); |
| 604 unittest.expect(o[1], unittest.equals('foo')); |
| 605 } |
| 606 |
| 607 buildUnnamed2290() { |
| 608 var o = new core.List<core.String>(); |
| 609 o.add("foo"); |
| 610 o.add("foo"); |
| 611 return o; |
| 612 } |
| 613 |
| 614 checkUnnamed2290(core.List<core.String> o) { |
| 615 unittest.expect(o, unittest.hasLength(2)); |
| 616 unittest.expect(o[0], unittest.equals('foo')); |
| 617 unittest.expect(o[1], unittest.equals('foo')); |
| 618 } |
| 619 |
| 620 buildUnnamed2291() { |
| 621 var o = new core.List<core.String>(); |
| 622 o.add("foo"); |
| 623 o.add("foo"); |
| 624 return o; |
| 625 } |
| 626 |
| 627 checkUnnamed2291(core.List<core.String> o) { |
| 628 unittest.expect(o, unittest.hasLength(2)); |
| 629 unittest.expect(o[0], unittest.equals('foo')); |
| 630 unittest.expect(o[1], unittest.equals('foo')); |
| 631 } |
| 632 |
| 633 buildUnnamed2292() { |
| 634 var o = new core.List<core.String>(); |
| 635 o.add("foo"); |
| 636 o.add("foo"); |
| 637 return o; |
| 638 } |
| 639 |
| 640 checkUnnamed2292(core.List<core.String> o) { |
| 641 unittest.expect(o, unittest.hasLength(2)); |
| 642 unittest.expect(o[0], unittest.equals('foo')); |
| 643 unittest.expect(o[1], unittest.equals('foo')); |
| 644 } |
| 645 |
| 646 buildUnnamed2293() { |
| 647 var o = new core.List<core.String>(); |
| 648 o.add("foo"); |
| 649 o.add("foo"); |
| 650 return o; |
| 651 } |
| 652 |
| 653 checkUnnamed2293(core.List<core.String> o) { |
| 654 unittest.expect(o, unittest.hasLength(2)); |
| 655 unittest.expect(o[0], unittest.equals('foo')); |
| 656 unittest.expect(o[1], unittest.equals('foo')); |
| 657 } |
| 658 |
| 659 buildUnnamed2294() { |
| 660 var o = new core.List<core.String>(); |
| 661 o.add("foo"); |
| 662 o.add("foo"); |
| 663 return o; |
| 664 } |
| 665 |
| 666 checkUnnamed2294(core.List<core.String> o) { |
| 667 unittest.expect(o, unittest.hasLength(2)); |
| 668 unittest.expect(o[0], unittest.equals('foo')); |
| 669 unittest.expect(o[1], unittest.equals('foo')); |
| 670 } |
| 671 |
| 672 buildUnnamed2295() { |
| 673 var o = new core.List<core.String>(); |
| 674 o.add("foo"); |
| 675 o.add("foo"); |
| 676 return o; |
| 677 } |
| 678 |
| 679 checkUnnamed2295(core.List<core.String> o) { |
| 680 unittest.expect(o, unittest.hasLength(2)); |
| 681 unittest.expect(o[0], unittest.equals('foo')); |
| 682 unittest.expect(o[1], unittest.equals('foo')); |
| 683 } |
| 684 |
| 685 buildUnnamed2296() { |
| 686 var o = new core.List<core.String>(); |
| 687 o.add("foo"); |
| 688 o.add("foo"); |
| 689 return o; |
| 690 } |
| 691 |
| 692 checkUnnamed2296(core.List<core.String> o) { |
| 693 unittest.expect(o, unittest.hasLength(2)); |
| 694 unittest.expect(o[0], unittest.equals('foo')); |
| 695 unittest.expect(o[1], unittest.equals('foo')); |
| 696 } |
| 697 |
| 698 buildUnnamed2297() { |
| 699 var o = new core.List<core.String>(); |
| 700 o.add("foo"); |
| 701 o.add("foo"); |
| 702 return o; |
| 703 } |
| 704 |
| 705 checkUnnamed2297(core.List<core.String> o) { |
| 706 unittest.expect(o, unittest.hasLength(2)); |
| 707 unittest.expect(o[0], unittest.equals('foo')); |
| 708 unittest.expect(o[1], unittest.equals('foo')); |
| 709 } |
| 710 |
| 711 buildUnnamed2298() { |
| 712 var o = new core.List<core.String>(); |
| 713 o.add("foo"); |
| 714 o.add("foo"); |
| 715 return o; |
| 716 } |
| 717 |
| 718 checkUnnamed2298(core.List<core.String> o) { |
| 719 unittest.expect(o, unittest.hasLength(2)); |
| 720 unittest.expect(o[0], unittest.equals('foo')); |
| 721 unittest.expect(o[1], unittest.equals('foo')); |
| 722 } |
| 723 |
| 724 buildUnnamed2299() { |
| 725 var o = new core.List<core.String>(); |
| 726 o.add("foo"); |
| 727 o.add("foo"); |
| 728 return o; |
| 729 } |
| 730 |
| 731 checkUnnamed2299(core.List<core.String> o) { |
| 732 unittest.expect(o, unittest.hasLength(2)); |
| 733 unittest.expect(o[0], unittest.equals('foo')); |
| 734 unittest.expect(o[1], unittest.equals('foo')); |
| 735 } |
| 736 |
54 | 737 |
55 main() { | 738 main() { |
56 } | 739 unittest.group("obj-schema-Avail", () { |
57 | 740 unittest.test("to-json--from-json", () { |
| 741 var o = buildAvail(); |
| 742 var od = new api.Avail.fromJson(o.toJson()); |
| 743 checkAvail(od); |
| 744 }); |
| 745 }); |
| 746 |
| 747 |
| 748 unittest.group("obj-schema-ExperienceLocale", () { |
| 749 unittest.test("to-json--from-json", () { |
| 750 var o = buildExperienceLocale(); |
| 751 var od = new api.ExperienceLocale.fromJson(o.toJson()); |
| 752 checkExperienceLocale(od); |
| 753 }); |
| 754 }); |
| 755 |
| 756 |
| 757 unittest.group("obj-schema-ListAvailsResponse", () { |
| 758 unittest.test("to-json--from-json", () { |
| 759 var o = buildListAvailsResponse(); |
| 760 var od = new api.ListAvailsResponse.fromJson(o.toJson()); |
| 761 checkListAvailsResponse(od); |
| 762 }); |
| 763 }); |
| 764 |
| 765 |
| 766 unittest.group("obj-schema-ListExperienceLocalesResponse", () { |
| 767 unittest.test("to-json--from-json", () { |
| 768 var o = buildListExperienceLocalesResponse(); |
| 769 var od = new api.ListExperienceLocalesResponse.fromJson(o.toJson()); |
| 770 checkListExperienceLocalesResponse(od); |
| 771 }); |
| 772 }); |
| 773 |
| 774 |
| 775 unittest.group("obj-schema-ListOrdersResponse", () { |
| 776 unittest.test("to-json--from-json", () { |
| 777 var o = buildListOrdersResponse(); |
| 778 var od = new api.ListOrdersResponse.fromJson(o.toJson()); |
| 779 checkListOrdersResponse(od); |
| 780 }); |
| 781 }); |
| 782 |
| 783 |
| 784 unittest.group("obj-schema-ListStoreInfosResponse", () { |
| 785 unittest.test("to-json--from-json", () { |
| 786 var o = buildListStoreInfosResponse(); |
| 787 var od = new api.ListStoreInfosResponse.fromJson(o.toJson()); |
| 788 checkListStoreInfosResponse(od); |
| 789 }); |
| 790 }); |
| 791 |
| 792 |
| 793 unittest.group("obj-schema-Order", () { |
| 794 unittest.test("to-json--from-json", () { |
| 795 var o = buildOrder(); |
| 796 var od = new api.Order.fromJson(o.toJson()); |
| 797 checkOrder(od); |
| 798 }); |
| 799 }); |
| 800 |
| 801 |
| 802 unittest.group("obj-schema-StoreInfo", () { |
| 803 unittest.test("to-json--from-json", () { |
| 804 var o = buildStoreInfo(); |
| 805 var od = new api.StoreInfo.fromJson(o.toJson()); |
| 806 checkStoreInfo(od); |
| 807 }); |
| 808 }); |
| 809 |
| 810 |
| 811 unittest.group("resource-AccountsAvailsResourceApi", () { |
| 812 unittest.test("method--list", () { |
| 813 |
| 814 var mock = new HttpServerMock(); |
| 815 api.AccountsAvailsResourceApi res = new api.PlaymoviespartnerApi(mock).acc
ounts.avails; |
| 816 var arg_accountId = "foo"; |
| 817 var arg_pageSize = 42; |
| 818 var arg_pageToken = "foo"; |
| 819 var arg_pphNames = buildUnnamed2286(); |
| 820 var arg_studioNames = buildUnnamed2287(); |
| 821 var arg_title = "foo"; |
| 822 var arg_territories = buildUnnamed2288(); |
| 823 var arg_altId = "foo"; |
| 824 var arg_videoIds = buildUnnamed2289(); |
| 825 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 826 var path = (req.url).path; |
| 827 var pathOffset = 0; |
| 828 var index; |
| 829 var subPart; |
| 830 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 831 pathOffset += 1; |
| 832 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/accounts/")); |
| 833 pathOffset += 12; |
| 834 index = path.indexOf("/avails", pathOffset); |
| 835 unittest.expect(index >= 0, unittest.isTrue); |
| 836 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 837 pathOffset = index; |
| 838 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 839 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/avails")); |
| 840 pathOffset += 7; |
| 841 |
| 842 var query = (req.url).query; |
| 843 var queryOffset = 0; |
| 844 var queryMap = {}; |
| 845 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 846 parseBool(n) { |
| 847 if (n == "true") return true; |
| 848 if (n == "false") return false; |
| 849 if (n == null) return null; |
| 850 throw new core.ArgumentError("Invalid boolean: $n"); |
| 851 } |
| 852 if (query.length > 0) { |
| 853 for (var part in query.split("&")) { |
| 854 var keyvalue = part.split("="); |
| 855 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 856 } |
| 857 } |
| 858 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 859 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 860 unittest.expect(queryMap["pphNames"], unittest.equals(arg_pphNames)); |
| 861 unittest.expect(queryMap["studioNames"], unittest.equals(arg_studioNames
)); |
| 862 unittest.expect(queryMap["title"].first, unittest.equals(arg_title)); |
| 863 unittest.expect(queryMap["territories"], unittest.equals(arg_territories
)); |
| 864 unittest.expect(queryMap["altId"].first, unittest.equals(arg_altId)); |
| 865 unittest.expect(queryMap["videoIds"], unittest.equals(arg_videoIds)); |
| 866 |
| 867 |
| 868 var h = { |
| 869 "content-type" : "application/json; charset=utf-8", |
| 870 }; |
| 871 var resp = convert.JSON.encode(buildListAvailsResponse()); |
| 872 return new async.Future.value(stringResponse(200, h, resp)); |
| 873 }), true); |
| 874 res.list(arg_accountId, pageSize: arg_pageSize, pageToken: arg_pageToken,
pphNames: arg_pphNames, studioNames: arg_studioNames, title: arg_title, territor
ies: arg_territories, altId: arg_altId, videoIds: arg_videoIds).then(unittest.ex
pectAsync(((api.ListAvailsResponse response) { |
| 875 checkListAvailsResponse(response); |
| 876 }))); |
| 877 }); |
| 878 |
| 879 }); |
| 880 |
| 881 |
| 882 unittest.group("resource-AccountsExperienceLocalesResourceApi", () { |
| 883 unittest.test("method--get", () { |
| 884 |
| 885 var mock = new HttpServerMock(); |
| 886 api.AccountsExperienceLocalesResourceApi res = new api.PlaymoviespartnerAp
i(mock).accounts.experienceLocales; |
| 887 var arg_accountId = "foo"; |
| 888 var arg_elId = "foo"; |
| 889 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 890 var path = (req.url).path; |
| 891 var pathOffset = 0; |
| 892 var index; |
| 893 var subPart; |
| 894 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 895 pathOffset += 1; |
| 896 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/accounts/")); |
| 897 pathOffset += 12; |
| 898 index = path.indexOf("/experienceLocales/", pathOffset); |
| 899 unittest.expect(index >= 0, unittest.isTrue); |
| 900 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 901 pathOffset = index; |
| 902 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 903 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("/experienceLocales/")); |
| 904 pathOffset += 19; |
| 905 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 906 pathOffset = path.length; |
| 907 unittest.expect(subPart, unittest.equals("$arg_elId")); |
| 908 |
| 909 var query = (req.url).query; |
| 910 var queryOffset = 0; |
| 911 var queryMap = {}; |
| 912 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 913 parseBool(n) { |
| 914 if (n == "true") return true; |
| 915 if (n == "false") return false; |
| 916 if (n == null) return null; |
| 917 throw new core.ArgumentError("Invalid boolean: $n"); |
| 918 } |
| 919 if (query.length > 0) { |
| 920 for (var part in query.split("&")) { |
| 921 var keyvalue = part.split("="); |
| 922 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 923 } |
| 924 } |
| 925 |
| 926 |
| 927 var h = { |
| 928 "content-type" : "application/json; charset=utf-8", |
| 929 }; |
| 930 var resp = convert.JSON.encode(buildExperienceLocale()); |
| 931 return new async.Future.value(stringResponse(200, h, resp)); |
| 932 }), true); |
| 933 res.get(arg_accountId, arg_elId).then(unittest.expectAsync(((api.Experienc
eLocale response) { |
| 934 checkExperienceLocale(response); |
| 935 }))); |
| 936 }); |
| 937 |
| 938 unittest.test("method--list", () { |
| 939 |
| 940 var mock = new HttpServerMock(); |
| 941 api.AccountsExperienceLocalesResourceApi res = new api.PlaymoviespartnerAp
i(mock).accounts.experienceLocales; |
| 942 var arg_accountId = "foo"; |
| 943 var arg_pageSize = 42; |
| 944 var arg_pageToken = "foo"; |
| 945 var arg_pphNames = buildUnnamed2290(); |
| 946 var arg_studioNames = buildUnnamed2291(); |
| 947 var arg_titleLevelEidr = "foo"; |
| 948 var arg_editLevelEidr = "foo"; |
| 949 var arg_status = buildUnnamed2292(); |
| 950 var arg_customId = "foo"; |
| 951 var arg_altCutId = "foo"; |
| 952 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 953 var path = (req.url).path; |
| 954 var pathOffset = 0; |
| 955 var index; |
| 956 var subPart; |
| 957 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 958 pathOffset += 1; |
| 959 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/accounts/")); |
| 960 pathOffset += 12; |
| 961 index = path.indexOf("/experienceLocales", pathOffset); |
| 962 unittest.expect(index >= 0, unittest.isTrue); |
| 963 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 964 pathOffset = index; |
| 965 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 966 unittest.expect(path.substring(pathOffset, pathOffset + 18), unittest.eq
uals("/experienceLocales")); |
| 967 pathOffset += 18; |
| 968 |
| 969 var query = (req.url).query; |
| 970 var queryOffset = 0; |
| 971 var queryMap = {}; |
| 972 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 973 parseBool(n) { |
| 974 if (n == "true") return true; |
| 975 if (n == "false") return false; |
| 976 if (n == null) return null; |
| 977 throw new core.ArgumentError("Invalid boolean: $n"); |
| 978 } |
| 979 if (query.length > 0) { |
| 980 for (var part in query.split("&")) { |
| 981 var keyvalue = part.split("="); |
| 982 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 983 } |
| 984 } |
| 985 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 986 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 987 unittest.expect(queryMap["pphNames"], unittest.equals(arg_pphNames)); |
| 988 unittest.expect(queryMap["studioNames"], unittest.equals(arg_studioNames
)); |
| 989 unittest.expect(queryMap["titleLevelEidr"].first, unittest.equals(arg_ti
tleLevelEidr)); |
| 990 unittest.expect(queryMap["editLevelEidr"].first, unittest.equals(arg_edi
tLevelEidr)); |
| 991 unittest.expect(queryMap["status"], unittest.equals(arg_status)); |
| 992 unittest.expect(queryMap["customId"].first, unittest.equals(arg_customId
)); |
| 993 unittest.expect(queryMap["altCutId"].first, unittest.equals(arg_altCutId
)); |
| 994 |
| 995 |
| 996 var h = { |
| 997 "content-type" : "application/json; charset=utf-8", |
| 998 }; |
| 999 var resp = convert.JSON.encode(buildListExperienceLocalesResponse()); |
| 1000 return new async.Future.value(stringResponse(200, h, resp)); |
| 1001 }), true); |
| 1002 res.list(arg_accountId, pageSize: arg_pageSize, pageToken: arg_pageToken,
pphNames: arg_pphNames, studioNames: arg_studioNames, titleLevelEidr: arg_titleL
evelEidr, editLevelEidr: arg_editLevelEidr, status: arg_status, customId: arg_cu
stomId, altCutId: arg_altCutId).then(unittest.expectAsync(((api.ListExperienceLo
calesResponse response) { |
| 1003 checkListExperienceLocalesResponse(response); |
| 1004 }))); |
| 1005 }); |
| 1006 |
| 1007 }); |
| 1008 |
| 1009 |
| 1010 unittest.group("resource-AccountsOrdersResourceApi", () { |
| 1011 unittest.test("method--get", () { |
| 1012 |
| 1013 var mock = new HttpServerMock(); |
| 1014 api.AccountsOrdersResourceApi res = new api.PlaymoviespartnerApi(mock).acc
ounts.orders; |
| 1015 var arg_accountId = "foo"; |
| 1016 var arg_orderId = "foo"; |
| 1017 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1018 var path = (req.url).path; |
| 1019 var pathOffset = 0; |
| 1020 var index; |
| 1021 var subPart; |
| 1022 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1023 pathOffset += 1; |
| 1024 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/accounts/")); |
| 1025 pathOffset += 12; |
| 1026 index = path.indexOf("/orders/", pathOffset); |
| 1027 unittest.expect(index >= 0, unittest.isTrue); |
| 1028 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 1029 pathOffset = index; |
| 1030 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 1031 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/orders/")); |
| 1032 pathOffset += 8; |
| 1033 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 1034 pathOffset = path.length; |
| 1035 unittest.expect(subPart, unittest.equals("$arg_orderId")); |
| 1036 |
| 1037 var query = (req.url).query; |
| 1038 var queryOffset = 0; |
| 1039 var queryMap = {}; |
| 1040 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1041 parseBool(n) { |
| 1042 if (n == "true") return true; |
| 1043 if (n == "false") return false; |
| 1044 if (n == null) return null; |
| 1045 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1046 } |
| 1047 if (query.length > 0) { |
| 1048 for (var part in query.split("&")) { |
| 1049 var keyvalue = part.split("="); |
| 1050 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1051 } |
| 1052 } |
| 1053 |
| 1054 |
| 1055 var h = { |
| 1056 "content-type" : "application/json; charset=utf-8", |
| 1057 }; |
| 1058 var resp = convert.JSON.encode(buildOrder()); |
| 1059 return new async.Future.value(stringResponse(200, h, resp)); |
| 1060 }), true); |
| 1061 res.get(arg_accountId, arg_orderId).then(unittest.expectAsync(((api.Order
response) { |
| 1062 checkOrder(response); |
| 1063 }))); |
| 1064 }); |
| 1065 |
| 1066 unittest.test("method--list", () { |
| 1067 |
| 1068 var mock = new HttpServerMock(); |
| 1069 api.AccountsOrdersResourceApi res = new api.PlaymoviespartnerApi(mock).acc
ounts.orders; |
| 1070 var arg_accountId = "foo"; |
| 1071 var arg_pageSize = 42; |
| 1072 var arg_pageToken = "foo"; |
| 1073 var arg_pphNames = buildUnnamed2293(); |
| 1074 var arg_studioNames = buildUnnamed2294(); |
| 1075 var arg_name = "foo"; |
| 1076 var arg_status = buildUnnamed2295(); |
| 1077 var arg_customId = "foo"; |
| 1078 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1079 var path = (req.url).path; |
| 1080 var pathOffset = 0; |
| 1081 var index; |
| 1082 var subPart; |
| 1083 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1084 pathOffset += 1; |
| 1085 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/accounts/")); |
| 1086 pathOffset += 12; |
| 1087 index = path.indexOf("/orders", pathOffset); |
| 1088 unittest.expect(index >= 0, unittest.isTrue); |
| 1089 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 1090 pathOffset = index; |
| 1091 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 1092 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/orders")); |
| 1093 pathOffset += 7; |
| 1094 |
| 1095 var query = (req.url).query; |
| 1096 var queryOffset = 0; |
| 1097 var queryMap = {}; |
| 1098 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1099 parseBool(n) { |
| 1100 if (n == "true") return true; |
| 1101 if (n == "false") return false; |
| 1102 if (n == null) return null; |
| 1103 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1104 } |
| 1105 if (query.length > 0) { |
| 1106 for (var part in query.split("&")) { |
| 1107 var keyvalue = part.split("="); |
| 1108 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1109 } |
| 1110 } |
| 1111 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 1112 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 1113 unittest.expect(queryMap["pphNames"], unittest.equals(arg_pphNames)); |
| 1114 unittest.expect(queryMap["studioNames"], unittest.equals(arg_studioNames
)); |
| 1115 unittest.expect(queryMap["name"].first, unittest.equals(arg_name)); |
| 1116 unittest.expect(queryMap["status"], unittest.equals(arg_status)); |
| 1117 unittest.expect(queryMap["customId"].first, unittest.equals(arg_customId
)); |
| 1118 |
| 1119 |
| 1120 var h = { |
| 1121 "content-type" : "application/json; charset=utf-8", |
| 1122 }; |
| 1123 var resp = convert.JSON.encode(buildListOrdersResponse()); |
| 1124 return new async.Future.value(stringResponse(200, h, resp)); |
| 1125 }), true); |
| 1126 res.list(arg_accountId, pageSize: arg_pageSize, pageToken: arg_pageToken,
pphNames: arg_pphNames, studioNames: arg_studioNames, name: arg_name, status: ar
g_status, customId: arg_customId).then(unittest.expectAsync(((api.ListOrdersResp
onse response) { |
| 1127 checkListOrdersResponse(response); |
| 1128 }))); |
| 1129 }); |
| 1130 |
| 1131 }); |
| 1132 |
| 1133 |
| 1134 unittest.group("resource-AccountsStoreInfosResourceApi", () { |
| 1135 unittest.test("method--list", () { |
| 1136 |
| 1137 var mock = new HttpServerMock(); |
| 1138 api.AccountsStoreInfosResourceApi res = new api.PlaymoviespartnerApi(mock)
.accounts.storeInfos; |
| 1139 var arg_accountId = "foo"; |
| 1140 var arg_pageSize = 42; |
| 1141 var arg_pageToken = "foo"; |
| 1142 var arg_pphNames = buildUnnamed2296(); |
| 1143 var arg_studioNames = buildUnnamed2297(); |
| 1144 var arg_videoId = "foo"; |
| 1145 var arg_countries = buildUnnamed2298(); |
| 1146 var arg_name = "foo"; |
| 1147 var arg_videoIds = buildUnnamed2299(); |
| 1148 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1149 var path = (req.url).path; |
| 1150 var pathOffset = 0; |
| 1151 var index; |
| 1152 var subPart; |
| 1153 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1154 pathOffset += 1; |
| 1155 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/accounts/")); |
| 1156 pathOffset += 12; |
| 1157 index = path.indexOf("/storeInfos", pathOffset); |
| 1158 unittest.expect(index >= 0, unittest.isTrue); |
| 1159 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 1160 pathOffset = index; |
| 1161 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 1162 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/storeInfos")); |
| 1163 pathOffset += 11; |
| 1164 |
| 1165 var query = (req.url).query; |
| 1166 var queryOffset = 0; |
| 1167 var queryMap = {}; |
| 1168 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1169 parseBool(n) { |
| 1170 if (n == "true") return true; |
| 1171 if (n == "false") return false; |
| 1172 if (n == null) return null; |
| 1173 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1174 } |
| 1175 if (query.length > 0) { |
| 1176 for (var part in query.split("&")) { |
| 1177 var keyvalue = part.split("="); |
| 1178 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1179 } |
| 1180 } |
| 1181 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 1182 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 1183 unittest.expect(queryMap["pphNames"], unittest.equals(arg_pphNames)); |
| 1184 unittest.expect(queryMap["studioNames"], unittest.equals(arg_studioNames
)); |
| 1185 unittest.expect(queryMap["videoId"].first, unittest.equals(arg_videoId))
; |
| 1186 unittest.expect(queryMap["countries"], unittest.equals(arg_countries)); |
| 1187 unittest.expect(queryMap["name"].first, unittest.equals(arg_name)); |
| 1188 unittest.expect(queryMap["videoIds"], unittest.equals(arg_videoIds)); |
| 1189 |
| 1190 |
| 1191 var h = { |
| 1192 "content-type" : "application/json; charset=utf-8", |
| 1193 }; |
| 1194 var resp = convert.JSON.encode(buildListStoreInfosResponse()); |
| 1195 return new async.Future.value(stringResponse(200, h, resp)); |
| 1196 }), true); |
| 1197 res.list(arg_accountId, pageSize: arg_pageSize, pageToken: arg_pageToken,
pphNames: arg_pphNames, studioNames: arg_studioNames, videoId: arg_videoId, coun
tries: arg_countries, name: arg_name, videoIds: arg_videoIds).then(unittest.expe
ctAsync(((api.ListStoreInfosResponse response) { |
| 1198 checkListStoreInfosResponse(response); |
| 1199 }))); |
| 1200 }); |
| 1201 |
| 1202 }); |
| 1203 |
| 1204 |
| 1205 unittest.group("resource-AccountsStoreInfosCountryResourceApi", () { |
| 1206 unittest.test("method--get", () { |
| 1207 |
| 1208 var mock = new HttpServerMock(); |
| 1209 api.AccountsStoreInfosCountryResourceApi res = new api.PlaymoviespartnerAp
i(mock).accounts.storeInfos.country; |
| 1210 var arg_accountId = "foo"; |
| 1211 var arg_videoId = "foo"; |
| 1212 var arg_country = "foo"; |
| 1213 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1214 var path = (req.url).path; |
| 1215 var pathOffset = 0; |
| 1216 var index; |
| 1217 var subPart; |
| 1218 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1219 pathOffset += 1; |
| 1220 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/accounts/")); |
| 1221 pathOffset += 12; |
| 1222 index = path.indexOf("/storeInfos/", pathOffset); |
| 1223 unittest.expect(index >= 0, unittest.isTrue); |
| 1224 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 1225 pathOffset = index; |
| 1226 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 1227 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/storeInfos/")); |
| 1228 pathOffset += 12; |
| 1229 index = path.indexOf("/country/", pathOffset); |
| 1230 unittest.expect(index >= 0, unittest.isTrue); |
| 1231 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 1232 pathOffset = index; |
| 1233 unittest.expect(subPart, unittest.equals("$arg_videoId")); |
| 1234 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/country/")); |
| 1235 pathOffset += 9; |
| 1236 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 1237 pathOffset = path.length; |
| 1238 unittest.expect(subPart, unittest.equals("$arg_country")); |
| 1239 |
| 1240 var query = (req.url).query; |
| 1241 var queryOffset = 0; |
| 1242 var queryMap = {}; |
| 1243 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1244 parseBool(n) { |
| 1245 if (n == "true") return true; |
| 1246 if (n == "false") return false; |
| 1247 if (n == null) return null; |
| 1248 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1249 } |
| 1250 if (query.length > 0) { |
| 1251 for (var part in query.split("&")) { |
| 1252 var keyvalue = part.split("="); |
| 1253 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1254 } |
| 1255 } |
| 1256 |
| 1257 |
| 1258 var h = { |
| 1259 "content-type" : "application/json; charset=utf-8", |
| 1260 }; |
| 1261 var resp = convert.JSON.encode(buildStoreInfo()); |
| 1262 return new async.Future.value(stringResponse(200, h, resp)); |
| 1263 }), true); |
| 1264 res.get(arg_accountId, arg_videoId, arg_country).then(unittest.expectAsync
(((api.StoreInfo response) { |
| 1265 checkStoreInfo(response); |
| 1266 }))); |
| 1267 }); |
| 1268 |
| 1269 }); |
| 1270 |
| 1271 |
| 1272 } |
| 1273 |
OLD | NEW |