Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(821)

Side by Side Diff: generated/googleapis/test/adsensehost/v4_1_test.dart

Issue 1078053002: Roll of googleapis as of 4/7/2015. (Closed) Base URL: https://github.com/dart-lang/googleapis.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 library googleapis.adsensehost.v4_1.test; 1 library googleapis.adsensehost.v4_1.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;
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 11
15 import 'package:googleapis/adsensehost/v4_1.dart' as api; 12 import 'package:googleapis/adsensehost/v4_1.dart' as api;
16 13
14 class HttpServerMock extends http.BaseClient {
15 core.Function _callback;
16 core.bool _expectJson;
17 17
18 void register(core.Function callback, core.bool expectJson) {
19 _callback = callback;
20 _expectJson = expectJson;
21 }
22
23 async.Future<http.StreamedResponse> send(http.BaseRequest request) {
24 if (_expectJson) {
25 return request.finalize()
26 .transform(convert.UTF8.decoder)
27 .join('')
28 .then((core.String jsonString) {
29 if (jsonString.isEmpty) {
30 return _callback(request, null);
31 } else {
32 return _callback(request, convert.JSON.decode(jsonString));
33 }
34 });
35 } else {
36 var stream = request.finalize();
37 if (stream == null) {
38 return _callback(request, []);
39 } else {
40 return stream.toBytes().then((data) {
41 return _callback(request, data);
42 });
43 }
44 }
45 }
46 }
47
48 http.StreamedResponse stringResponse(
49 core.int status, core.Map headers, core.String body) {
50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]);
51 return new http.StreamedResponse(stream, status, headers: headers);
52 }
18 53
19 core.int buildCounterAccount = 0; 54 core.int buildCounterAccount = 0;
20 buildAccount() { 55 buildAccount() {
21 var o = new api.Account(); 56 var o = new api.Account();
22 buildCounterAccount++; 57 buildCounterAccount++;
23 if (buildCounterAccount < 3) { 58 if (buildCounterAccount < 3) {
24 o.id = "foo"; 59 o.id = "foo";
25 o.kind = "foo"; 60 o.kind = "foo";
26 o.name = "foo"; 61 o.name = "foo";
27 o.status = "foo"; 62 o.status = "foo";
28 } 63 }
29 buildCounterAccount--; 64 buildCounterAccount--;
30 return o; 65 return o;
31 } 66 }
32 67
33 checkAccount(api.Account o) { 68 checkAccount(api.Account o) {
34 buildCounterAccount++; 69 buildCounterAccount++;
35 if (buildCounterAccount < 3) { 70 if (buildCounterAccount < 3) {
36 unittest.expect(o.id, unittest.equals('foo')); 71 unittest.expect(o.id, unittest.equals('foo'));
37 unittest.expect(o.kind, unittest.equals('foo')); 72 unittest.expect(o.kind, unittest.equals('foo'));
38 unittest.expect(o.name, unittest.equals('foo')); 73 unittest.expect(o.name, unittest.equals('foo'));
39 unittest.expect(o.status, unittest.equals('foo')); 74 unittest.expect(o.status, unittest.equals('foo'));
40 } 75 }
41 buildCounterAccount--; 76 buildCounterAccount--;
42 } 77 }
43 78
44 buildUnnamed1411() { 79 buildUnnamed164() {
45 var o = new core.List<api.Account>(); 80 var o = new core.List<api.Account>();
46 o.add(buildAccount()); 81 o.add(buildAccount());
47 o.add(buildAccount()); 82 o.add(buildAccount());
48 return o; 83 return o;
49 } 84 }
50 85
51 checkUnnamed1411(core.List<api.Account> o) { 86 checkUnnamed164(core.List<api.Account> o) {
52 unittest.expect(o, unittest.hasLength(2)); 87 unittest.expect(o, unittest.hasLength(2));
53 checkAccount(o[0]); 88 checkAccount(o[0]);
54 checkAccount(o[1]); 89 checkAccount(o[1]);
55 } 90 }
56 91
57 core.int buildCounterAccounts = 0; 92 core.int buildCounterAccounts = 0;
58 buildAccounts() { 93 buildAccounts() {
59 var o = new api.Accounts(); 94 var o = new api.Accounts();
60 buildCounterAccounts++; 95 buildCounterAccounts++;
61 if (buildCounterAccounts < 3) { 96 if (buildCounterAccounts < 3) {
62 o.etag = "foo"; 97 o.etag = "foo";
63 o.items = buildUnnamed1411(); 98 o.items = buildUnnamed164();
64 o.kind = "foo"; 99 o.kind = "foo";
65 } 100 }
66 buildCounterAccounts--; 101 buildCounterAccounts--;
67 return o; 102 return o;
68 } 103 }
69 104
70 checkAccounts(api.Accounts o) { 105 checkAccounts(api.Accounts o) {
71 buildCounterAccounts++; 106 buildCounterAccounts++;
72 if (buildCounterAccounts < 3) { 107 if (buildCounterAccounts < 3) {
73 unittest.expect(o.etag, unittest.equals('foo')); 108 unittest.expect(o.etag, unittest.equals('foo'));
74 checkUnnamed1411(o.items); 109 checkUnnamed164(o.items);
75 unittest.expect(o.kind, unittest.equals('foo')); 110 unittest.expect(o.kind, unittest.equals('foo'));
76 } 111 }
77 buildCounterAccounts--; 112 buildCounterAccounts--;
78 } 113 }
79 114
80 core.int buildCounterAdClient = 0; 115 core.int buildCounterAdClient = 0;
81 buildAdClient() { 116 buildAdClient() {
82 var o = new api.AdClient(); 117 var o = new api.AdClient();
83 buildCounterAdClient++; 118 buildCounterAdClient++;
84 if (buildCounterAdClient < 3) { 119 if (buildCounterAdClient < 3) {
(...skipping 12 matching lines...) Expand all
97 if (buildCounterAdClient < 3) { 132 if (buildCounterAdClient < 3) {
98 unittest.expect(o.arcOptIn, unittest.isTrue); 133 unittest.expect(o.arcOptIn, unittest.isTrue);
99 unittest.expect(o.id, unittest.equals('foo')); 134 unittest.expect(o.id, unittest.equals('foo'));
100 unittest.expect(o.kind, unittest.equals('foo')); 135 unittest.expect(o.kind, unittest.equals('foo'));
101 unittest.expect(o.productCode, unittest.equals('foo')); 136 unittest.expect(o.productCode, unittest.equals('foo'));
102 unittest.expect(o.supportsReporting, unittest.isTrue); 137 unittest.expect(o.supportsReporting, unittest.isTrue);
103 } 138 }
104 buildCounterAdClient--; 139 buildCounterAdClient--;
105 } 140 }
106 141
107 buildUnnamed1412() { 142 buildUnnamed165() {
108 var o = new core.List<api.AdClient>(); 143 var o = new core.List<api.AdClient>();
109 o.add(buildAdClient()); 144 o.add(buildAdClient());
110 o.add(buildAdClient()); 145 o.add(buildAdClient());
111 return o; 146 return o;
112 } 147 }
113 148
114 checkUnnamed1412(core.List<api.AdClient> o) { 149 checkUnnamed165(core.List<api.AdClient> o) {
115 unittest.expect(o, unittest.hasLength(2)); 150 unittest.expect(o, unittest.hasLength(2));
116 checkAdClient(o[0]); 151 checkAdClient(o[0]);
117 checkAdClient(o[1]); 152 checkAdClient(o[1]);
118 } 153 }
119 154
120 core.int buildCounterAdClients = 0; 155 core.int buildCounterAdClients = 0;
121 buildAdClients() { 156 buildAdClients() {
122 var o = new api.AdClients(); 157 var o = new api.AdClients();
123 buildCounterAdClients++; 158 buildCounterAdClients++;
124 if (buildCounterAdClients < 3) { 159 if (buildCounterAdClients < 3) {
125 o.etag = "foo"; 160 o.etag = "foo";
126 o.items = buildUnnamed1412(); 161 o.items = buildUnnamed165();
127 o.kind = "foo"; 162 o.kind = "foo";
128 o.nextPageToken = "foo"; 163 o.nextPageToken = "foo";
129 } 164 }
130 buildCounterAdClients--; 165 buildCounterAdClients--;
131 return o; 166 return o;
132 } 167 }
133 168
134 checkAdClients(api.AdClients o) { 169 checkAdClients(api.AdClients o) {
135 buildCounterAdClients++; 170 buildCounterAdClients++;
136 if (buildCounterAdClients < 3) { 171 if (buildCounterAdClients < 3) {
137 unittest.expect(o.etag, unittest.equals('foo')); 172 unittest.expect(o.etag, unittest.equals('foo'));
138 checkUnnamed1412(o.items); 173 checkUnnamed165(o.items);
139 unittest.expect(o.kind, unittest.equals('foo')); 174 unittest.expect(o.kind, unittest.equals('foo'));
140 unittest.expect(o.nextPageToken, unittest.equals('foo')); 175 unittest.expect(o.nextPageToken, unittest.equals('foo'));
141 } 176 }
142 buildCounterAdClients--; 177 buildCounterAdClients--;
143 } 178 }
144 179
145 core.int buildCounterAdCode = 0; 180 core.int buildCounterAdCode = 0;
146 buildAdCode() { 181 buildAdCode() {
147 var o = new api.AdCode(); 182 var o = new api.AdCode();
148 buildCounterAdCode++; 183 buildCounterAdCode++;
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 checkAdStyle(o.customStyle); 368 checkAdStyle(o.customStyle);
334 unittest.expect(o.id, unittest.equals('foo')); 369 unittest.expect(o.id, unittest.equals('foo'));
335 unittest.expect(o.kind, unittest.equals('foo')); 370 unittest.expect(o.kind, unittest.equals('foo'));
336 checkAdUnitMobileContentAdsSettings(o.mobileContentAdsSettings); 371 checkAdUnitMobileContentAdsSettings(o.mobileContentAdsSettings);
337 unittest.expect(o.name, unittest.equals('foo')); 372 unittest.expect(o.name, unittest.equals('foo'));
338 unittest.expect(o.status, unittest.equals('foo')); 373 unittest.expect(o.status, unittest.equals('foo'));
339 } 374 }
340 buildCounterAdUnit--; 375 buildCounterAdUnit--;
341 } 376 }
342 377
343 buildUnnamed1413() { 378 buildUnnamed166() {
344 var o = new core.List<api.AdUnit>(); 379 var o = new core.List<api.AdUnit>();
345 o.add(buildAdUnit()); 380 o.add(buildAdUnit());
346 o.add(buildAdUnit()); 381 o.add(buildAdUnit());
347 return o; 382 return o;
348 } 383 }
349 384
350 checkUnnamed1413(core.List<api.AdUnit> o) { 385 checkUnnamed166(core.List<api.AdUnit> o) {
351 unittest.expect(o, unittest.hasLength(2)); 386 unittest.expect(o, unittest.hasLength(2));
352 checkAdUnit(o[0]); 387 checkAdUnit(o[0]);
353 checkAdUnit(o[1]); 388 checkAdUnit(o[1]);
354 } 389 }
355 390
356 core.int buildCounterAdUnits = 0; 391 core.int buildCounterAdUnits = 0;
357 buildAdUnits() { 392 buildAdUnits() {
358 var o = new api.AdUnits(); 393 var o = new api.AdUnits();
359 buildCounterAdUnits++; 394 buildCounterAdUnits++;
360 if (buildCounterAdUnits < 3) { 395 if (buildCounterAdUnits < 3) {
361 o.etag = "foo"; 396 o.etag = "foo";
362 o.items = buildUnnamed1413(); 397 o.items = buildUnnamed166();
363 o.kind = "foo"; 398 o.kind = "foo";
364 o.nextPageToken = "foo"; 399 o.nextPageToken = "foo";
365 } 400 }
366 buildCounterAdUnits--; 401 buildCounterAdUnits--;
367 return o; 402 return o;
368 } 403 }
369 404
370 checkAdUnits(api.AdUnits o) { 405 checkAdUnits(api.AdUnits o) {
371 buildCounterAdUnits++; 406 buildCounterAdUnits++;
372 if (buildCounterAdUnits < 3) { 407 if (buildCounterAdUnits < 3) {
373 unittest.expect(o.etag, unittest.equals('foo')); 408 unittest.expect(o.etag, unittest.equals('foo'));
374 checkUnnamed1413(o.items); 409 checkUnnamed166(o.items);
375 unittest.expect(o.kind, unittest.equals('foo')); 410 unittest.expect(o.kind, unittest.equals('foo'));
376 unittest.expect(o.nextPageToken, unittest.equals('foo')); 411 unittest.expect(o.nextPageToken, unittest.equals('foo'));
377 } 412 }
378 buildCounterAdUnits--; 413 buildCounterAdUnits--;
379 } 414 }
380 415
381 buildUnnamed1414() { 416 buildUnnamed167() {
382 var o = new core.List<core.String>(); 417 var o = new core.List<core.String>();
383 o.add("foo"); 418 o.add("foo");
384 o.add("foo"); 419 o.add("foo");
385 return o; 420 return o;
386 } 421 }
387 422
388 checkUnnamed1414(core.List<core.String> o) { 423 checkUnnamed167(core.List<core.String> o) {
389 unittest.expect(o, unittest.hasLength(2)); 424 unittest.expect(o, unittest.hasLength(2));
390 unittest.expect(o[0], unittest.equals('foo')); 425 unittest.expect(o[0], unittest.equals('foo'));
391 unittest.expect(o[1], unittest.equals('foo')); 426 unittest.expect(o[1], unittest.equals('foo'));
392 } 427 }
393 428
394 core.int buildCounterAssociationSession = 0; 429 core.int buildCounterAssociationSession = 0;
395 buildAssociationSession() { 430 buildAssociationSession() {
396 var o = new api.AssociationSession(); 431 var o = new api.AssociationSession();
397 buildCounterAssociationSession++; 432 buildCounterAssociationSession++;
398 if (buildCounterAssociationSession < 3) { 433 if (buildCounterAssociationSession < 3) {
399 o.accountId = "foo"; 434 o.accountId = "foo";
400 o.id = "foo"; 435 o.id = "foo";
401 o.kind = "foo"; 436 o.kind = "foo";
402 o.productCodes = buildUnnamed1414(); 437 o.productCodes = buildUnnamed167();
403 o.redirectUrl = "foo"; 438 o.redirectUrl = "foo";
404 o.status = "foo"; 439 o.status = "foo";
405 o.userLocale = "foo"; 440 o.userLocale = "foo";
406 o.websiteLocale = "foo"; 441 o.websiteLocale = "foo";
407 o.websiteUrl = "foo"; 442 o.websiteUrl = "foo";
408 } 443 }
409 buildCounterAssociationSession--; 444 buildCounterAssociationSession--;
410 return o; 445 return o;
411 } 446 }
412 447
413 checkAssociationSession(api.AssociationSession o) { 448 checkAssociationSession(api.AssociationSession o) {
414 buildCounterAssociationSession++; 449 buildCounterAssociationSession++;
415 if (buildCounterAssociationSession < 3) { 450 if (buildCounterAssociationSession < 3) {
416 unittest.expect(o.accountId, unittest.equals('foo')); 451 unittest.expect(o.accountId, unittest.equals('foo'));
417 unittest.expect(o.id, unittest.equals('foo')); 452 unittest.expect(o.id, unittest.equals('foo'));
418 unittest.expect(o.kind, unittest.equals('foo')); 453 unittest.expect(o.kind, unittest.equals('foo'));
419 checkUnnamed1414(o.productCodes); 454 checkUnnamed167(o.productCodes);
420 unittest.expect(o.redirectUrl, unittest.equals('foo')); 455 unittest.expect(o.redirectUrl, unittest.equals('foo'));
421 unittest.expect(o.status, unittest.equals('foo')); 456 unittest.expect(o.status, unittest.equals('foo'));
422 unittest.expect(o.userLocale, unittest.equals('foo')); 457 unittest.expect(o.userLocale, unittest.equals('foo'));
423 unittest.expect(o.websiteLocale, unittest.equals('foo')); 458 unittest.expect(o.websiteLocale, unittest.equals('foo'));
424 unittest.expect(o.websiteUrl, unittest.equals('foo')); 459 unittest.expect(o.websiteUrl, unittest.equals('foo'));
425 } 460 }
426 buildCounterAssociationSession--; 461 buildCounterAssociationSession--;
427 } 462 }
428 463
429 core.int buildCounterCustomChannel = 0; 464 core.int buildCounterCustomChannel = 0;
(...skipping 14 matching lines...) Expand all
444 buildCounterCustomChannel++; 479 buildCounterCustomChannel++;
445 if (buildCounterCustomChannel < 3) { 480 if (buildCounterCustomChannel < 3) {
446 unittest.expect(o.code, unittest.equals('foo')); 481 unittest.expect(o.code, unittest.equals('foo'));
447 unittest.expect(o.id, unittest.equals('foo')); 482 unittest.expect(o.id, unittest.equals('foo'));
448 unittest.expect(o.kind, unittest.equals('foo')); 483 unittest.expect(o.kind, unittest.equals('foo'));
449 unittest.expect(o.name, unittest.equals('foo')); 484 unittest.expect(o.name, unittest.equals('foo'));
450 } 485 }
451 buildCounterCustomChannel--; 486 buildCounterCustomChannel--;
452 } 487 }
453 488
454 buildUnnamed1415() { 489 buildUnnamed168() {
455 var o = new core.List<api.CustomChannel>(); 490 var o = new core.List<api.CustomChannel>();
456 o.add(buildCustomChannel()); 491 o.add(buildCustomChannel());
457 o.add(buildCustomChannel()); 492 o.add(buildCustomChannel());
458 return o; 493 return o;
459 } 494 }
460 495
461 checkUnnamed1415(core.List<api.CustomChannel> o) { 496 checkUnnamed168(core.List<api.CustomChannel> o) {
462 unittest.expect(o, unittest.hasLength(2)); 497 unittest.expect(o, unittest.hasLength(2));
463 checkCustomChannel(o[0]); 498 checkCustomChannel(o[0]);
464 checkCustomChannel(o[1]); 499 checkCustomChannel(o[1]);
465 } 500 }
466 501
467 core.int buildCounterCustomChannels = 0; 502 core.int buildCounterCustomChannels = 0;
468 buildCustomChannels() { 503 buildCustomChannels() {
469 var o = new api.CustomChannels(); 504 var o = new api.CustomChannels();
470 buildCounterCustomChannels++; 505 buildCounterCustomChannels++;
471 if (buildCounterCustomChannels < 3) { 506 if (buildCounterCustomChannels < 3) {
472 o.etag = "foo"; 507 o.etag = "foo";
473 o.items = buildUnnamed1415(); 508 o.items = buildUnnamed168();
474 o.kind = "foo"; 509 o.kind = "foo";
475 o.nextPageToken = "foo"; 510 o.nextPageToken = "foo";
476 } 511 }
477 buildCounterCustomChannels--; 512 buildCounterCustomChannels--;
478 return o; 513 return o;
479 } 514 }
480 515
481 checkCustomChannels(api.CustomChannels o) { 516 checkCustomChannels(api.CustomChannels o) {
482 buildCounterCustomChannels++; 517 buildCounterCustomChannels++;
483 if (buildCounterCustomChannels < 3) { 518 if (buildCounterCustomChannels < 3) {
484 unittest.expect(o.etag, unittest.equals('foo')); 519 unittest.expect(o.etag, unittest.equals('foo'));
485 checkUnnamed1415(o.items); 520 checkUnnamed168(o.items);
486 unittest.expect(o.kind, unittest.equals('foo')); 521 unittest.expect(o.kind, unittest.equals('foo'));
487 unittest.expect(o.nextPageToken, unittest.equals('foo')); 522 unittest.expect(o.nextPageToken, unittest.equals('foo'));
488 } 523 }
489 buildCounterCustomChannels--; 524 buildCounterCustomChannels--;
490 } 525 }
491 526
492 buildUnnamed1416() { 527 buildUnnamed169() {
493 var o = new core.List<core.String>(); 528 var o = new core.List<core.String>();
494 o.add("foo"); 529 o.add("foo");
495 o.add("foo"); 530 o.add("foo");
496 return o; 531 return o;
497 } 532 }
498 533
499 checkUnnamed1416(core.List<core.String> o) { 534 checkUnnamed169(core.List<core.String> o) {
500 unittest.expect(o, unittest.hasLength(2)); 535 unittest.expect(o, unittest.hasLength(2));
501 unittest.expect(o[0], unittest.equals('foo')); 536 unittest.expect(o[0], unittest.equals('foo'));
502 unittest.expect(o[1], unittest.equals('foo')); 537 unittest.expect(o[1], unittest.equals('foo'));
503 } 538 }
504 539
505 core.int buildCounterReportHeaders = 0; 540 core.int buildCounterReportHeaders = 0;
506 buildReportHeaders() { 541 buildReportHeaders() {
507 var o = new api.ReportHeaders(); 542 var o = new api.ReportHeaders();
508 buildCounterReportHeaders++; 543 buildCounterReportHeaders++;
509 if (buildCounterReportHeaders < 3) { 544 if (buildCounterReportHeaders < 3) {
510 o.currency = "foo"; 545 o.currency = "foo";
511 o.name = "foo"; 546 o.name = "foo";
512 o.type = "foo"; 547 o.type = "foo";
513 } 548 }
514 buildCounterReportHeaders--; 549 buildCounterReportHeaders--;
515 return o; 550 return o;
516 } 551 }
517 552
518 checkReportHeaders(api.ReportHeaders o) { 553 checkReportHeaders(api.ReportHeaders o) {
519 buildCounterReportHeaders++; 554 buildCounterReportHeaders++;
520 if (buildCounterReportHeaders < 3) { 555 if (buildCounterReportHeaders < 3) {
521 unittest.expect(o.currency, unittest.equals('foo')); 556 unittest.expect(o.currency, unittest.equals('foo'));
522 unittest.expect(o.name, unittest.equals('foo')); 557 unittest.expect(o.name, unittest.equals('foo'));
523 unittest.expect(o.type, unittest.equals('foo')); 558 unittest.expect(o.type, unittest.equals('foo'));
524 } 559 }
525 buildCounterReportHeaders--; 560 buildCounterReportHeaders--;
526 } 561 }
527 562
528 buildUnnamed1417() { 563 buildUnnamed170() {
529 var o = new core.List<api.ReportHeaders>(); 564 var o = new core.List<api.ReportHeaders>();
530 o.add(buildReportHeaders()); 565 o.add(buildReportHeaders());
531 o.add(buildReportHeaders()); 566 o.add(buildReportHeaders());
532 return o; 567 return o;
533 } 568 }
534 569
535 checkUnnamed1417(core.List<api.ReportHeaders> o) { 570 checkUnnamed170(core.List<api.ReportHeaders> o) {
536 unittest.expect(o, unittest.hasLength(2)); 571 unittest.expect(o, unittest.hasLength(2));
537 checkReportHeaders(o[0]); 572 checkReportHeaders(o[0]);
538 checkReportHeaders(o[1]); 573 checkReportHeaders(o[1]);
539 } 574 }
540 575
541 buildUnnamed1418() { 576 buildUnnamed171() {
542 var o = new core.List<core.String>(); 577 var o = new core.List<core.String>();
543 o.add("foo"); 578 o.add("foo");
544 o.add("foo"); 579 o.add("foo");
545 return o; 580 return o;
546 } 581 }
547 582
548 checkUnnamed1418(core.List<core.String> o) { 583 checkUnnamed171(core.List<core.String> o) {
549 unittest.expect(o, unittest.hasLength(2)); 584 unittest.expect(o, unittest.hasLength(2));
550 unittest.expect(o[0], unittest.equals('foo')); 585 unittest.expect(o[0], unittest.equals('foo'));
551 unittest.expect(o[1], unittest.equals('foo')); 586 unittest.expect(o[1], unittest.equals('foo'));
552 } 587 }
553 588
554 buildUnnamed1419() { 589 buildUnnamed172() {
555 var o = new core.List<core.List<core.String>>(); 590 var o = new core.List<core.List<core.String>>();
556 o.add(buildUnnamed1418()); 591 o.add(buildUnnamed171());
557 o.add(buildUnnamed1418()); 592 o.add(buildUnnamed171());
558 return o; 593 return o;
559 } 594 }
560 595
561 checkUnnamed1419(core.List<core.List<core.String>> o) { 596 checkUnnamed172(core.List<core.List<core.String>> o) {
562 unittest.expect(o, unittest.hasLength(2)); 597 unittest.expect(o, unittest.hasLength(2));
563 checkUnnamed1418(o[0]); 598 checkUnnamed171(o[0]);
564 checkUnnamed1418(o[1]); 599 checkUnnamed171(o[1]);
565 } 600 }
566 601
567 buildUnnamed1420() { 602 buildUnnamed173() {
568 var o = new core.List<core.String>(); 603 var o = new core.List<core.String>();
569 o.add("foo"); 604 o.add("foo");
570 o.add("foo"); 605 o.add("foo");
571 return o; 606 return o;
572 } 607 }
573 608
574 checkUnnamed1420(core.List<core.String> o) { 609 checkUnnamed173(core.List<core.String> o) {
575 unittest.expect(o, unittest.hasLength(2)); 610 unittest.expect(o, unittest.hasLength(2));
576 unittest.expect(o[0], unittest.equals('foo')); 611 unittest.expect(o[0], unittest.equals('foo'));
577 unittest.expect(o[1], unittest.equals('foo')); 612 unittest.expect(o[1], unittest.equals('foo'));
578 } 613 }
579 614
580 buildUnnamed1421() { 615 buildUnnamed174() {
581 var o = new core.List<core.String>(); 616 var o = new core.List<core.String>();
582 o.add("foo"); 617 o.add("foo");
583 o.add("foo"); 618 o.add("foo");
584 return o; 619 return o;
585 } 620 }
586 621
587 checkUnnamed1421(core.List<core.String> o) { 622 checkUnnamed174(core.List<core.String> o) {
588 unittest.expect(o, unittest.hasLength(2)); 623 unittest.expect(o, unittest.hasLength(2));
589 unittest.expect(o[0], unittest.equals('foo')); 624 unittest.expect(o[0], unittest.equals('foo'));
590 unittest.expect(o[1], unittest.equals('foo')); 625 unittest.expect(o[1], unittest.equals('foo'));
591 } 626 }
592 627
593 core.int buildCounterReport = 0; 628 core.int buildCounterReport = 0;
594 buildReport() { 629 buildReport() {
595 var o = new api.Report(); 630 var o = new api.Report();
596 buildCounterReport++; 631 buildCounterReport++;
597 if (buildCounterReport < 3) { 632 if (buildCounterReport < 3) {
598 o.averages = buildUnnamed1416(); 633 o.averages = buildUnnamed169();
599 o.headers = buildUnnamed1417(); 634 o.headers = buildUnnamed170();
600 o.kind = "foo"; 635 o.kind = "foo";
601 o.rows = buildUnnamed1419(); 636 o.rows = buildUnnamed172();
602 o.totalMatchedRows = "foo"; 637 o.totalMatchedRows = "foo";
603 o.totals = buildUnnamed1420(); 638 o.totals = buildUnnamed173();
604 o.warnings = buildUnnamed1421(); 639 o.warnings = buildUnnamed174();
605 } 640 }
606 buildCounterReport--; 641 buildCounterReport--;
607 return o; 642 return o;
608 } 643 }
609 644
610 checkReport(api.Report o) { 645 checkReport(api.Report o) {
611 buildCounterReport++; 646 buildCounterReport++;
612 if (buildCounterReport < 3) { 647 if (buildCounterReport < 3) {
613 checkUnnamed1416(o.averages); 648 checkUnnamed169(o.averages);
614 checkUnnamed1417(o.headers); 649 checkUnnamed170(o.headers);
615 unittest.expect(o.kind, unittest.equals('foo')); 650 unittest.expect(o.kind, unittest.equals('foo'));
616 checkUnnamed1419(o.rows); 651 checkUnnamed172(o.rows);
617 unittest.expect(o.totalMatchedRows, unittest.equals('foo')); 652 unittest.expect(o.totalMatchedRows, unittest.equals('foo'));
618 checkUnnamed1420(o.totals); 653 checkUnnamed173(o.totals);
619 checkUnnamed1421(o.warnings); 654 checkUnnamed174(o.warnings);
620 } 655 }
621 buildCounterReport--; 656 buildCounterReport--;
622 } 657 }
623 658
624 core.int buildCounterUrlChannel = 0; 659 core.int buildCounterUrlChannel = 0;
625 buildUrlChannel() { 660 buildUrlChannel() {
626 var o = new api.UrlChannel(); 661 var o = new api.UrlChannel();
627 buildCounterUrlChannel++; 662 buildCounterUrlChannel++;
628 if (buildCounterUrlChannel < 3) { 663 if (buildCounterUrlChannel < 3) {
629 o.id = "foo"; 664 o.id = "foo";
630 o.kind = "foo"; 665 o.kind = "foo";
631 o.urlPattern = "foo"; 666 o.urlPattern = "foo";
632 } 667 }
633 buildCounterUrlChannel--; 668 buildCounterUrlChannel--;
634 return o; 669 return o;
635 } 670 }
636 671
637 checkUrlChannel(api.UrlChannel o) { 672 checkUrlChannel(api.UrlChannel o) {
638 buildCounterUrlChannel++; 673 buildCounterUrlChannel++;
639 if (buildCounterUrlChannel < 3) { 674 if (buildCounterUrlChannel < 3) {
640 unittest.expect(o.id, unittest.equals('foo')); 675 unittest.expect(o.id, unittest.equals('foo'));
641 unittest.expect(o.kind, unittest.equals('foo')); 676 unittest.expect(o.kind, unittest.equals('foo'));
642 unittest.expect(o.urlPattern, unittest.equals('foo')); 677 unittest.expect(o.urlPattern, unittest.equals('foo'));
643 } 678 }
644 buildCounterUrlChannel--; 679 buildCounterUrlChannel--;
645 } 680 }
646 681
647 buildUnnamed1422() { 682 buildUnnamed175() {
648 var o = new core.List<api.UrlChannel>(); 683 var o = new core.List<api.UrlChannel>();
649 o.add(buildUrlChannel()); 684 o.add(buildUrlChannel());
650 o.add(buildUrlChannel()); 685 o.add(buildUrlChannel());
651 return o; 686 return o;
652 } 687 }
653 688
654 checkUnnamed1422(core.List<api.UrlChannel> o) { 689 checkUnnamed175(core.List<api.UrlChannel> o) {
655 unittest.expect(o, unittest.hasLength(2)); 690 unittest.expect(o, unittest.hasLength(2));
656 checkUrlChannel(o[0]); 691 checkUrlChannel(o[0]);
657 checkUrlChannel(o[1]); 692 checkUrlChannel(o[1]);
658 } 693 }
659 694
660 core.int buildCounterUrlChannels = 0; 695 core.int buildCounterUrlChannels = 0;
661 buildUrlChannels() { 696 buildUrlChannels() {
662 var o = new api.UrlChannels(); 697 var o = new api.UrlChannels();
663 buildCounterUrlChannels++; 698 buildCounterUrlChannels++;
664 if (buildCounterUrlChannels < 3) { 699 if (buildCounterUrlChannels < 3) {
665 o.etag = "foo"; 700 o.etag = "foo";
666 o.items = buildUnnamed1422(); 701 o.items = buildUnnamed175();
667 o.kind = "foo"; 702 o.kind = "foo";
668 o.nextPageToken = "foo"; 703 o.nextPageToken = "foo";
669 } 704 }
670 buildCounterUrlChannels--; 705 buildCounterUrlChannels--;
671 return o; 706 return o;
672 } 707 }
673 708
674 checkUrlChannels(api.UrlChannels o) { 709 checkUrlChannels(api.UrlChannels o) {
675 buildCounterUrlChannels++; 710 buildCounterUrlChannels++;
676 if (buildCounterUrlChannels < 3) { 711 if (buildCounterUrlChannels < 3) {
677 unittest.expect(o.etag, unittest.equals('foo')); 712 unittest.expect(o.etag, unittest.equals('foo'));
678 checkUnnamed1422(o.items); 713 checkUnnamed175(o.items);
679 unittest.expect(o.kind, unittest.equals('foo')); 714 unittest.expect(o.kind, unittest.equals('foo'));
680 unittest.expect(o.nextPageToken, unittest.equals('foo')); 715 unittest.expect(o.nextPageToken, unittest.equals('foo'));
681 } 716 }
682 buildCounterUrlChannels--; 717 buildCounterUrlChannels--;
683 } 718 }
684 719
685 buildUnnamed1423() { 720 buildUnnamed176() {
686 var o = new core.List<core.String>(); 721 var o = new core.List<core.String>();
687 o.add("foo"); 722 o.add("foo");
688 o.add("foo"); 723 o.add("foo");
689 return o; 724 return o;
690 } 725 }
691 726
692 checkUnnamed1423(core.List<core.String> o) { 727 checkUnnamed176(core.List<core.String> o) {
693 unittest.expect(o, unittest.hasLength(2)); 728 unittest.expect(o, unittest.hasLength(2));
694 unittest.expect(o[0], unittest.equals('foo')); 729 unittest.expect(o[0], unittest.equals('foo'));
695 unittest.expect(o[1], unittest.equals('foo')); 730 unittest.expect(o[1], unittest.equals('foo'));
696 } 731 }
697 732
698 buildUnnamed1424() { 733 buildUnnamed177() {
699 var o = new core.List<core.String>(); 734 var o = new core.List<core.String>();
700 o.add("foo"); 735 o.add("foo");
701 o.add("foo"); 736 o.add("foo");
702 return o; 737 return o;
703 } 738 }
704 739
705 checkUnnamed1424(core.List<core.String> o) { 740 checkUnnamed177(core.List<core.String> o) {
706 unittest.expect(o, unittest.hasLength(2)); 741 unittest.expect(o, unittest.hasLength(2));
707 unittest.expect(o[0], unittest.equals('foo')); 742 unittest.expect(o[0], unittest.equals('foo'));
708 unittest.expect(o[1], unittest.equals('foo')); 743 unittest.expect(o[1], unittest.equals('foo'));
709 } 744 }
710 745
711 buildUnnamed1425() { 746 buildUnnamed178() {
712 var o = new core.List<core.String>(); 747 var o = new core.List<core.String>();
713 o.add("foo"); 748 o.add("foo");
714 o.add("foo"); 749 o.add("foo");
715 return o; 750 return o;
716 } 751 }
717 752
718 checkUnnamed1425(core.List<core.String> o) { 753 checkUnnamed178(core.List<core.String> o) {
719 unittest.expect(o, unittest.hasLength(2)); 754 unittest.expect(o, unittest.hasLength(2));
720 unittest.expect(o[0], unittest.equals('foo')); 755 unittest.expect(o[0], unittest.equals('foo'));
721 unittest.expect(o[1], unittest.equals('foo')); 756 unittest.expect(o[1], unittest.equals('foo'));
722 } 757 }
723 758
724 buildUnnamed1426() { 759 buildUnnamed179() {
725 var o = new core.List<core.String>(); 760 var o = new core.List<core.String>();
726 o.add("foo"); 761 o.add("foo");
727 o.add("foo"); 762 o.add("foo");
728 return o; 763 return o;
729 } 764 }
730 765
731 checkUnnamed1426(core.List<core.String> o) { 766 checkUnnamed179(core.List<core.String> o) {
732 unittest.expect(o, unittest.hasLength(2)); 767 unittest.expect(o, unittest.hasLength(2));
733 unittest.expect(o[0], unittest.equals('foo')); 768 unittest.expect(o[0], unittest.equals('foo'));
734 unittest.expect(o[1], unittest.equals('foo')); 769 unittest.expect(o[1], unittest.equals('foo'));
735 } 770 }
736 771
737 buildUnnamed1427() { 772 buildUnnamed180() {
738 var o = new core.List<core.String>(); 773 var o = new core.List<core.String>();
739 o.add("foo"); 774 o.add("foo");
740 o.add("foo"); 775 o.add("foo");
741 return o; 776 return o;
742 } 777 }
743 778
744 checkUnnamed1427(core.List<core.String> o) { 779 checkUnnamed180(core.List<core.String> o) {
745 unittest.expect(o, unittest.hasLength(2)); 780 unittest.expect(o, unittest.hasLength(2));
746 unittest.expect(o[0], unittest.equals('foo')); 781 unittest.expect(o[0], unittest.equals('foo'));
747 unittest.expect(o[1], unittest.equals('foo')); 782 unittest.expect(o[1], unittest.equals('foo'));
748 } 783 }
749 784
750 buildUnnamed1428() { 785 buildUnnamed181() {
751 var o = new core.List<core.String>(); 786 var o = new core.List<core.String>();
752 o.add("foo"); 787 o.add("foo");
753 o.add("foo"); 788 o.add("foo");
754 return o; 789 return o;
755 } 790 }
756 791
757 checkUnnamed1428(core.List<core.String> o) { 792 checkUnnamed181(core.List<core.String> o) {
758 unittest.expect(o, unittest.hasLength(2)); 793 unittest.expect(o, unittest.hasLength(2));
759 unittest.expect(o[0], unittest.equals('foo')); 794 unittest.expect(o[0], unittest.equals('foo'));
760 unittest.expect(o[1], unittest.equals('foo')); 795 unittest.expect(o[1], unittest.equals('foo'));
761 } 796 }
762 797
763 buildUnnamed1429() { 798 buildUnnamed182() {
764 var o = new core.List<core.String>(); 799 var o = new core.List<core.String>();
765 o.add("foo"); 800 o.add("foo");
766 o.add("foo"); 801 o.add("foo");
767 return o; 802 return o;
768 } 803 }
769 804
770 checkUnnamed1429(core.List<core.String> o) { 805 checkUnnamed182(core.List<core.String> o) {
771 unittest.expect(o, unittest.hasLength(2)); 806 unittest.expect(o, unittest.hasLength(2));
772 unittest.expect(o[0], unittest.equals('foo')); 807 unittest.expect(o[0], unittest.equals('foo'));
773 unittest.expect(o[1], unittest.equals('foo')); 808 unittest.expect(o[1], unittest.equals('foo'));
774 } 809 }
775 810
776 buildUnnamed1430() { 811 buildUnnamed183() {
777 var o = new core.List<core.String>(); 812 var o = new core.List<core.String>();
778 o.add("foo"); 813 o.add("foo");
779 o.add("foo"); 814 o.add("foo");
780 return o; 815 return o;
781 } 816 }
782 817
783 checkUnnamed1430(core.List<core.String> o) { 818 checkUnnamed183(core.List<core.String> o) {
784 unittest.expect(o, unittest.hasLength(2)); 819 unittest.expect(o, unittest.hasLength(2));
785 unittest.expect(o[0], unittest.equals('foo')); 820 unittest.expect(o[0], unittest.equals('foo'));
786 unittest.expect(o[1], unittest.equals('foo')); 821 unittest.expect(o[1], unittest.equals('foo'));
787 } 822 }
788 823
789 buildUnnamed1431() { 824 buildUnnamed184() {
790 var o = new core.List<core.String>(); 825 var o = new core.List<core.String>();
791 o.add("foo"); 826 o.add("foo");
792 o.add("foo"); 827 o.add("foo");
793 return o; 828 return o;
794 } 829 }
795 830
796 checkUnnamed1431(core.List<core.String> o) { 831 checkUnnamed184(core.List<core.String> o) {
797 unittest.expect(o, unittest.hasLength(2)); 832 unittest.expect(o, unittest.hasLength(2));
798 unittest.expect(o[0], unittest.equals('foo')); 833 unittest.expect(o[0], unittest.equals('foo'));
799 unittest.expect(o[1], unittest.equals('foo')); 834 unittest.expect(o[1], unittest.equals('foo'));
800 } 835 }
801 836
802 buildUnnamed1432() { 837 buildUnnamed185() {
803 var o = new core.List<core.String>(); 838 var o = new core.List<core.String>();
804 o.add("foo"); 839 o.add("foo");
805 o.add("foo"); 840 o.add("foo");
806 return o; 841 return o;
807 } 842 }
808 843
809 checkUnnamed1432(core.List<core.String> o) { 844 checkUnnamed185(core.List<core.String> o) {
810 unittest.expect(o, unittest.hasLength(2)); 845 unittest.expect(o, unittest.hasLength(2));
811 unittest.expect(o[0], unittest.equals('foo')); 846 unittest.expect(o[0], unittest.equals('foo'));
812 unittest.expect(o[1], unittest.equals('foo')); 847 unittest.expect(o[1], unittest.equals('foo'));
813 } 848 }
814 849
815 buildUnnamed1433() { 850 buildUnnamed186() {
816 var o = new core.List<core.String>(); 851 var o = new core.List<core.String>();
817 o.add("foo"); 852 o.add("foo");
818 o.add("foo"); 853 o.add("foo");
819 return o; 854 return o;
820 } 855 }
821 856
822 checkUnnamed1433(core.List<core.String> o) { 857 checkUnnamed186(core.List<core.String> o) {
823 unittest.expect(o, unittest.hasLength(2)); 858 unittest.expect(o, unittest.hasLength(2));
824 unittest.expect(o[0], unittest.equals('foo')); 859 unittest.expect(o[0], unittest.equals('foo'));
825 unittest.expect(o[1], unittest.equals('foo')); 860 unittest.expect(o[1], unittest.equals('foo'));
826 } 861 }
827 862
828 863
829 main() { 864 main() {
830 unittest.group("obj-schema-Account", () { 865 unittest.group("obj-schema-Account", () {
831 unittest.test("to-json--from-json", () { 866 unittest.test("to-json--from-json", () {
832 var o = buildAccount(); 867 var o = buildAccount();
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
1003 var o = buildUrlChannels(); 1038 var o = buildUrlChannels();
1004 var od = new api.UrlChannels.fromJson(o.toJson()); 1039 var od = new api.UrlChannels.fromJson(o.toJson());
1005 checkUrlChannels(od); 1040 checkUrlChannels(od);
1006 }); 1041 });
1007 }); 1042 });
1008 1043
1009 1044
1010 unittest.group("resource-AccountsResourceApi", () { 1045 unittest.group("resource-AccountsResourceApi", () {
1011 unittest.test("method--get", () { 1046 unittest.test("method--get", () {
1012 1047
1013 var mock = new common_test.HttpServerMock(); 1048 var mock = new HttpServerMock();
1014 api.AccountsResourceApi res = new api.AdsensehostApi(mock).accounts; 1049 api.AccountsResourceApi res = new api.AdsensehostApi(mock).accounts;
1015 var arg_accountId = "foo"; 1050 var arg_accountId = "foo";
1016 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 1051 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1017 var path = (req.url).path; 1052 var path = (req.url).path;
1018 var pathOffset = 0; 1053 var pathOffset = 0;
1019 var index; 1054 var index;
1020 var subPart; 1055 var subPart;
1021 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1056 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1022 pathOffset += 1; 1057 pathOffset += 1;
1023 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq uals("adsensehost/v4.1/")); 1058 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq uals("adsensehost/v4.1/"));
(...skipping 19 matching lines...) Expand all
1043 var keyvalue = part.split("="); 1078 var keyvalue = part.split("=");
1044 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1079 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1045 } 1080 }
1046 } 1081 }
1047 1082
1048 1083
1049 var h = { 1084 var h = {
1050 "content-type" : "application/json; charset=utf-8", 1085 "content-type" : "application/json; charset=utf-8",
1051 }; 1086 };
1052 var resp = convert.JSON.encode(buildAccount()); 1087 var resp = convert.JSON.encode(buildAccount());
1053 return new async.Future.value(common_test.stringResponse(200, h, resp)); 1088 return new async.Future.value(stringResponse(200, h, resp));
1054 }), true); 1089 }), true);
1055 res.get(arg_accountId).then(unittest.expectAsync(((api.Account response) { 1090 res.get(arg_accountId).then(unittest.expectAsync(((api.Account response) {
1056 checkAccount(response); 1091 checkAccount(response);
1057 }))); 1092 })));
1058 }); 1093 });
1059 1094
1060 unittest.test("method--list", () { 1095 unittest.test("method--list", () {
1061 1096
1062 var mock = new common_test.HttpServerMock(); 1097 var mock = new HttpServerMock();
1063 api.AccountsResourceApi res = new api.AdsensehostApi(mock).accounts; 1098 api.AccountsResourceApi res = new api.AdsensehostApi(mock).accounts;
1064 var arg_filterAdClientId = buildUnnamed1423(); 1099 var arg_filterAdClientId = buildUnnamed176();
1065 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 1100 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1066 var path = (req.url).path; 1101 var path = (req.url).path;
1067 var pathOffset = 0; 1102 var pathOffset = 0;
1068 var index; 1103 var index;
1069 var subPart; 1104 var subPart;
1070 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1105 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1071 pathOffset += 1; 1106 pathOffset += 1;
1072 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq uals("adsensehost/v4.1/")); 1107 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq uals("adsensehost/v4.1/"));
1073 pathOffset += 17; 1108 pathOffset += 17;
1074 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("accounts")); 1109 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("accounts"));
(...skipping 15 matching lines...) Expand all
1090 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1125 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1091 } 1126 }
1092 } 1127 }
1093 unittest.expect(queryMap["filterAdClientId"], unittest.equals(arg_filter AdClientId)); 1128 unittest.expect(queryMap["filterAdClientId"], unittest.equals(arg_filter AdClientId));
1094 1129
1095 1130
1096 var h = { 1131 var h = {
1097 "content-type" : "application/json; charset=utf-8", 1132 "content-type" : "application/json; charset=utf-8",
1098 }; 1133 };
1099 var resp = convert.JSON.encode(buildAccounts()); 1134 var resp = convert.JSON.encode(buildAccounts());
1100 return new async.Future.value(common_test.stringResponse(200, h, resp)); 1135 return new async.Future.value(stringResponse(200, h, resp));
1101 }), true); 1136 }), true);
1102 res.list(arg_filterAdClientId).then(unittest.expectAsync(((api.Accounts re sponse) { 1137 res.list(arg_filterAdClientId).then(unittest.expectAsync(((api.Accounts re sponse) {
1103 checkAccounts(response); 1138 checkAccounts(response);
1104 }))); 1139 })));
1105 }); 1140 });
1106 1141
1107 }); 1142 });
1108 1143
1109 1144
1110 unittest.group("resource-AccountsAdclientsResourceApi", () { 1145 unittest.group("resource-AccountsAdclientsResourceApi", () {
1111 unittest.test("method--get", () { 1146 unittest.test("method--get", () {
1112 1147
1113 var mock = new common_test.HttpServerMock(); 1148 var mock = new HttpServerMock();
1114 api.AccountsAdclientsResourceApi res = new api.AdsensehostApi(mock).accoun ts.adclients; 1149 api.AccountsAdclientsResourceApi res = new api.AdsensehostApi(mock).accoun ts.adclients;
1115 var arg_accountId = "foo"; 1150 var arg_accountId = "foo";
1116 var arg_adClientId = "foo"; 1151 var arg_adClientId = "foo";
1117 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 1152 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1118 var path = (req.url).path; 1153 var path = (req.url).path;
1119 var pathOffset = 0; 1154 var pathOffset = 0;
1120 var index; 1155 var index;
1121 var subPart; 1156 var subPart;
1122 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1157 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1123 pathOffset += 1; 1158 pathOffset += 1;
(...skipping 27 matching lines...) Expand all
1151 var keyvalue = part.split("="); 1186 var keyvalue = part.split("=");
1152 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1187 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1153 } 1188 }
1154 } 1189 }
1155 1190
1156 1191
1157 var h = { 1192 var h = {
1158 "content-type" : "application/json; charset=utf-8", 1193 "content-type" : "application/json; charset=utf-8",
1159 }; 1194 };
1160 var resp = convert.JSON.encode(buildAdClient()); 1195 var resp = convert.JSON.encode(buildAdClient());
1161 return new async.Future.value(common_test.stringResponse(200, h, resp)); 1196 return new async.Future.value(stringResponse(200, h, resp));
1162 }), true); 1197 }), true);
1163 res.get(arg_accountId, arg_adClientId).then(unittest.expectAsync(((api.AdC lient response) { 1198 res.get(arg_accountId, arg_adClientId).then(unittest.expectAsync(((api.AdC lient response) {
1164 checkAdClient(response); 1199 checkAdClient(response);
1165 }))); 1200 })));
1166 }); 1201 });
1167 1202
1168 unittest.test("method--list", () { 1203 unittest.test("method--list", () {
1169 1204
1170 var mock = new common_test.HttpServerMock(); 1205 var mock = new HttpServerMock();
1171 api.AccountsAdclientsResourceApi res = new api.AdsensehostApi(mock).accoun ts.adclients; 1206 api.AccountsAdclientsResourceApi res = new api.AdsensehostApi(mock).accoun ts.adclients;
1172 var arg_accountId = "foo"; 1207 var arg_accountId = "foo";
1173 var arg_maxResults = 42; 1208 var arg_maxResults = 42;
1174 var arg_pageToken = "foo"; 1209 var arg_pageToken = "foo";
1175 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 1210 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1176 var path = (req.url).path; 1211 var path = (req.url).path;
1177 var pathOffset = 0; 1212 var pathOffset = 0;
1178 var index; 1213 var index;
1179 var subPart; 1214 var subPart;
1180 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1215 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
(...skipping 27 matching lines...) Expand all
1208 } 1243 }
1209 } 1244 }
1210 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e quals(arg_maxResults)); 1245 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e quals(arg_maxResults));
1211 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en)); 1246 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
1212 1247
1213 1248
1214 var h = { 1249 var h = {
1215 "content-type" : "application/json; charset=utf-8", 1250 "content-type" : "application/json; charset=utf-8",
1216 }; 1251 };
1217 var resp = convert.JSON.encode(buildAdClients()); 1252 var resp = convert.JSON.encode(buildAdClients());
1218 return new async.Future.value(common_test.stringResponse(200, h, resp)); 1253 return new async.Future.value(stringResponse(200, h, resp));
1219 }), true); 1254 }), true);
1220 res.list(arg_accountId, maxResults: arg_maxResults, pageToken: arg_pageTok en).then(unittest.expectAsync(((api.AdClients response) { 1255 res.list(arg_accountId, maxResults: arg_maxResults, pageToken: arg_pageTok en).then(unittest.expectAsync(((api.AdClients response) {
1221 checkAdClients(response); 1256 checkAdClients(response);
1222 }))); 1257 })));
1223 }); 1258 });
1224 1259
1225 }); 1260 });
1226 1261
1227 1262
1228 unittest.group("resource-AccountsAdunitsResourceApi", () { 1263 unittest.group("resource-AccountsAdunitsResourceApi", () {
1229 unittest.test("method--delete", () { 1264 unittest.test("method--delete", () {
1230 1265
1231 var mock = new common_test.HttpServerMock(); 1266 var mock = new HttpServerMock();
1232 api.AccountsAdunitsResourceApi res = new api.AdsensehostApi(mock).accounts .adunits; 1267 api.AccountsAdunitsResourceApi res = new api.AdsensehostApi(mock).accounts .adunits;
1233 var arg_accountId = "foo"; 1268 var arg_accountId = "foo";
1234 var arg_adClientId = "foo"; 1269 var arg_adClientId = "foo";
1235 var arg_adUnitId = "foo"; 1270 var arg_adUnitId = "foo";
1236 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 1271 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1237 var path = (req.url).path; 1272 var path = (req.url).path;
1238 var pathOffset = 0; 1273 var pathOffset = 0;
1239 var index; 1274 var index;
1240 var subPart; 1275 var subPart;
1241 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1276 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1277 var keyvalue = part.split("="); 1312 var keyvalue = part.split("=");
1278 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1313 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1279 } 1314 }
1280 } 1315 }
1281 1316
1282 1317
1283 var h = { 1318 var h = {
1284 "content-type" : "application/json; charset=utf-8", 1319 "content-type" : "application/json; charset=utf-8",
1285 }; 1320 };
1286 var resp = convert.JSON.encode(buildAdUnit()); 1321 var resp = convert.JSON.encode(buildAdUnit());
1287 return new async.Future.value(common_test.stringResponse(200, h, resp)); 1322 return new async.Future.value(stringResponse(200, h, resp));
1288 }), true); 1323 }), true);
1289 res.delete(arg_accountId, arg_adClientId, arg_adUnitId).then(unittest.expe ctAsync(((api.AdUnit response) { 1324 res.delete(arg_accountId, arg_adClientId, arg_adUnitId).then(unittest.expe ctAsync(((api.AdUnit response) {
1290 checkAdUnit(response); 1325 checkAdUnit(response);
1291 }))); 1326 })));
1292 }); 1327 });
1293 1328
1294 unittest.test("method--get", () { 1329 unittest.test("method--get", () {
1295 1330
1296 var mock = new common_test.HttpServerMock(); 1331 var mock = new HttpServerMock();
1297 api.AccountsAdunitsResourceApi res = new api.AdsensehostApi(mock).accounts .adunits; 1332 api.AccountsAdunitsResourceApi res = new api.AdsensehostApi(mock).accounts .adunits;
1298 var arg_accountId = "foo"; 1333 var arg_accountId = "foo";
1299 var arg_adClientId = "foo"; 1334 var arg_adClientId = "foo";
1300 var arg_adUnitId = "foo"; 1335 var arg_adUnitId = "foo";
1301 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 1336 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1302 var path = (req.url).path; 1337 var path = (req.url).path;
1303 var pathOffset = 0; 1338 var pathOffset = 0;
1304 var index; 1339 var index;
1305 var subPart; 1340 var subPart;
1306 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1341 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1342 var keyvalue = part.split("="); 1377 var keyvalue = part.split("=");
1343 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1378 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1344 } 1379 }
1345 } 1380 }
1346 1381
1347 1382
1348 var h = { 1383 var h = {
1349 "content-type" : "application/json; charset=utf-8", 1384 "content-type" : "application/json; charset=utf-8",
1350 }; 1385 };
1351 var resp = convert.JSON.encode(buildAdUnit()); 1386 var resp = convert.JSON.encode(buildAdUnit());
1352 return new async.Future.value(common_test.stringResponse(200, h, resp)); 1387 return new async.Future.value(stringResponse(200, h, resp));
1353 }), true); 1388 }), true);
1354 res.get(arg_accountId, arg_adClientId, arg_adUnitId).then(unittest.expectA sync(((api.AdUnit response) { 1389 res.get(arg_accountId, arg_adClientId, arg_adUnitId).then(unittest.expectA sync(((api.AdUnit response) {
1355 checkAdUnit(response); 1390 checkAdUnit(response);
1356 }))); 1391 })));
1357 }); 1392 });
1358 1393
1359 unittest.test("method--getAdCode", () { 1394 unittest.test("method--getAdCode", () {
1360 1395
1361 var mock = new common_test.HttpServerMock(); 1396 var mock = new HttpServerMock();
1362 api.AccountsAdunitsResourceApi res = new api.AdsensehostApi(mock).accounts .adunits; 1397 api.AccountsAdunitsResourceApi res = new api.AdsensehostApi(mock).accounts .adunits;
1363 var arg_accountId = "foo"; 1398 var arg_accountId = "foo";
1364 var arg_adClientId = "foo"; 1399 var arg_adClientId = "foo";
1365 var arg_adUnitId = "foo"; 1400 var arg_adUnitId = "foo";
1366 var arg_hostCustomChannelId = buildUnnamed1424(); 1401 var arg_hostCustomChannelId = buildUnnamed177();
1367 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 1402 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1368 var path = (req.url).path; 1403 var path = (req.url).path;
1369 var pathOffset = 0; 1404 var pathOffset = 0;
1370 var index; 1405 var index;
1371 var subPart; 1406 var subPart;
1372 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1407 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1373 pathOffset += 1; 1408 pathOffset += 1;
1374 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq uals("adsensehost/v4.1/")); 1409 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq uals("adsensehost/v4.1/"));
1375 pathOffset += 17; 1410 pathOffset += 17;
1376 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als("accounts/")); 1411 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als("accounts/"));
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
1413 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1448 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1414 } 1449 }
1415 } 1450 }
1416 unittest.expect(queryMap["hostCustomChannelId"], unittest.equals(arg_hos tCustomChannelId)); 1451 unittest.expect(queryMap["hostCustomChannelId"], unittest.equals(arg_hos tCustomChannelId));
1417 1452
1418 1453
1419 var h = { 1454 var h = {
1420 "content-type" : "application/json; charset=utf-8", 1455 "content-type" : "application/json; charset=utf-8",
1421 }; 1456 };
1422 var resp = convert.JSON.encode(buildAdCode()); 1457 var resp = convert.JSON.encode(buildAdCode());
1423 return new async.Future.value(common_test.stringResponse(200, h, resp)); 1458 return new async.Future.value(stringResponse(200, h, resp));
1424 }), true); 1459 }), true);
1425 res.getAdCode(arg_accountId, arg_adClientId, arg_adUnitId, hostCustomChann elId: arg_hostCustomChannelId).then(unittest.expectAsync(((api.AdCode response) { 1460 res.getAdCode(arg_accountId, arg_adClientId, arg_adUnitId, hostCustomChann elId: arg_hostCustomChannelId).then(unittest.expectAsync(((api.AdCode response) {
1426 checkAdCode(response); 1461 checkAdCode(response);
1427 }))); 1462 })));
1428 }); 1463 });
1429 1464
1430 unittest.test("method--insert", () { 1465 unittest.test("method--insert", () {
1431 1466
1432 var mock = new common_test.HttpServerMock(); 1467 var mock = new HttpServerMock();
1433 api.AccountsAdunitsResourceApi res = new api.AdsensehostApi(mock).accounts .adunits; 1468 api.AccountsAdunitsResourceApi res = new api.AdsensehostApi(mock).accounts .adunits;
1434 var arg_request = buildAdUnit(); 1469 var arg_request = buildAdUnit();
1435 var arg_accountId = "foo"; 1470 var arg_accountId = "foo";
1436 var arg_adClientId = "foo"; 1471 var arg_adClientId = "foo";
1437 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 1472 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1438 var obj = new api.AdUnit.fromJson(json); 1473 var obj = new api.AdUnit.fromJson(json);
1439 checkAdUnit(obj); 1474 checkAdUnit(obj);
1440 1475
1441 var path = (req.url).path; 1476 var path = (req.url).path;
1442 var pathOffset = 0; 1477 var pathOffset = 0;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1478 var keyvalue = part.split("="); 1513 var keyvalue = part.split("=");
1479 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1514 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1480 } 1515 }
1481 } 1516 }
1482 1517
1483 1518
1484 var h = { 1519 var h = {
1485 "content-type" : "application/json; charset=utf-8", 1520 "content-type" : "application/json; charset=utf-8",
1486 }; 1521 };
1487 var resp = convert.JSON.encode(buildAdUnit()); 1522 var resp = convert.JSON.encode(buildAdUnit());
1488 return new async.Future.value(common_test.stringResponse(200, h, resp)); 1523 return new async.Future.value(stringResponse(200, h, resp));
1489 }), true); 1524 }), true);
1490 res.insert(arg_request, arg_accountId, arg_adClientId).then(unittest.expec tAsync(((api.AdUnit response) { 1525 res.insert(arg_request, arg_accountId, arg_adClientId).then(unittest.expec tAsync(((api.AdUnit response) {
1491 checkAdUnit(response); 1526 checkAdUnit(response);
1492 }))); 1527 })));
1493 }); 1528 });
1494 1529
1495 unittest.test("method--list", () { 1530 unittest.test("method--list", () {
1496 1531
1497 var mock = new common_test.HttpServerMock(); 1532 var mock = new HttpServerMock();
1498 api.AccountsAdunitsResourceApi res = new api.AdsensehostApi(mock).accounts .adunits; 1533 api.AccountsAdunitsResourceApi res = new api.AdsensehostApi(mock).accounts .adunits;
1499 var arg_accountId = "foo"; 1534 var arg_accountId = "foo";
1500 var arg_adClientId = "foo"; 1535 var arg_adClientId = "foo";
1501 var arg_includeInactive = true; 1536 var arg_includeInactive = true;
1502 var arg_maxResults = 42; 1537 var arg_maxResults = 42;
1503 var arg_pageToken = "foo"; 1538 var arg_pageToken = "foo";
1504 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 1539 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1505 var path = (req.url).path; 1540 var path = (req.url).path;
1506 var pathOffset = 0; 1541 var pathOffset = 0;
1507 var index; 1542 var index;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1545 } 1580 }
1546 unittest.expect(queryMap["includeInactive"].first, unittest.equals("$arg _includeInactive")); 1581 unittest.expect(queryMap["includeInactive"].first, unittest.equals("$arg _includeInactive"));
1547 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e quals(arg_maxResults)); 1582 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e quals(arg_maxResults));
1548 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en)); 1583 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
1549 1584
1550 1585
1551 var h = { 1586 var h = {
1552 "content-type" : "application/json; charset=utf-8", 1587 "content-type" : "application/json; charset=utf-8",
1553 }; 1588 };
1554 var resp = convert.JSON.encode(buildAdUnits()); 1589 var resp = convert.JSON.encode(buildAdUnits());
1555 return new async.Future.value(common_test.stringResponse(200, h, resp)); 1590 return new async.Future.value(stringResponse(200, h, resp));
1556 }), true); 1591 }), true);
1557 res.list(arg_accountId, arg_adClientId, includeInactive: arg_includeInacti ve, maxResults: arg_maxResults, pageToken: arg_pageToken).then(unittest.expectAs ync(((api.AdUnits response) { 1592 res.list(arg_accountId, arg_adClientId, includeInactive: arg_includeInacti ve, maxResults: arg_maxResults, pageToken: arg_pageToken).then(unittest.expectAs ync(((api.AdUnits response) {
1558 checkAdUnits(response); 1593 checkAdUnits(response);
1559 }))); 1594 })));
1560 }); 1595 });
1561 1596
1562 unittest.test("method--patch", () { 1597 unittest.test("method--patch", () {
1563 1598
1564 var mock = new common_test.HttpServerMock(); 1599 var mock = new HttpServerMock();
1565 api.AccountsAdunitsResourceApi res = new api.AdsensehostApi(mock).accounts .adunits; 1600 api.AccountsAdunitsResourceApi res = new api.AdsensehostApi(mock).accounts .adunits;
1566 var arg_request = buildAdUnit(); 1601 var arg_request = buildAdUnit();
1567 var arg_accountId = "foo"; 1602 var arg_accountId = "foo";
1568 var arg_adClientId = "foo"; 1603 var arg_adClientId = "foo";
1569 var arg_adUnitId = "foo"; 1604 var arg_adUnitId = "foo";
1570 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 1605 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1571 var obj = new api.AdUnit.fromJson(json); 1606 var obj = new api.AdUnit.fromJson(json);
1572 checkAdUnit(obj); 1607 checkAdUnit(obj);
1573 1608
1574 var path = (req.url).path; 1609 var path = (req.url).path;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1612 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1647 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1613 } 1648 }
1614 } 1649 }
1615 unittest.expect(queryMap["adUnitId"].first, unittest.equals(arg_adUnitId )); 1650 unittest.expect(queryMap["adUnitId"].first, unittest.equals(arg_adUnitId ));
1616 1651
1617 1652
1618 var h = { 1653 var h = {
1619 "content-type" : "application/json; charset=utf-8", 1654 "content-type" : "application/json; charset=utf-8",
1620 }; 1655 };
1621 var resp = convert.JSON.encode(buildAdUnit()); 1656 var resp = convert.JSON.encode(buildAdUnit());
1622 return new async.Future.value(common_test.stringResponse(200, h, resp)); 1657 return new async.Future.value(stringResponse(200, h, resp));
1623 }), true); 1658 }), true);
1624 res.patch(arg_request, arg_accountId, arg_adClientId, arg_adUnitId).then(u nittest.expectAsync(((api.AdUnit response) { 1659 res.patch(arg_request, arg_accountId, arg_adClientId, arg_adUnitId).then(u nittest.expectAsync(((api.AdUnit response) {
1625 checkAdUnit(response); 1660 checkAdUnit(response);
1626 }))); 1661 })));
1627 }); 1662 });
1628 1663
1629 unittest.test("method--update", () { 1664 unittest.test("method--update", () {
1630 1665
1631 var mock = new common_test.HttpServerMock(); 1666 var mock = new HttpServerMock();
1632 api.AccountsAdunitsResourceApi res = new api.AdsensehostApi(mock).accounts .adunits; 1667 api.AccountsAdunitsResourceApi res = new api.AdsensehostApi(mock).accounts .adunits;
1633 var arg_request = buildAdUnit(); 1668 var arg_request = buildAdUnit();
1634 var arg_accountId = "foo"; 1669 var arg_accountId = "foo";
1635 var arg_adClientId = "foo"; 1670 var arg_adClientId = "foo";
1636 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 1671 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1637 var obj = new api.AdUnit.fromJson(json); 1672 var obj = new api.AdUnit.fromJson(json);
1638 checkAdUnit(obj); 1673 checkAdUnit(obj);
1639 1674
1640 var path = (req.url).path; 1675 var path = (req.url).path;
1641 var pathOffset = 0; 1676 var pathOffset = 0;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1677 var keyvalue = part.split("="); 1712 var keyvalue = part.split("=");
1678 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1713 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1679 } 1714 }
1680 } 1715 }
1681 1716
1682 1717
1683 var h = { 1718 var h = {
1684 "content-type" : "application/json; charset=utf-8", 1719 "content-type" : "application/json; charset=utf-8",
1685 }; 1720 };
1686 var resp = convert.JSON.encode(buildAdUnit()); 1721 var resp = convert.JSON.encode(buildAdUnit());
1687 return new async.Future.value(common_test.stringResponse(200, h, resp)); 1722 return new async.Future.value(stringResponse(200, h, resp));
1688 }), true); 1723 }), true);
1689 res.update(arg_request, arg_accountId, arg_adClientId).then(unittest.expec tAsync(((api.AdUnit response) { 1724 res.update(arg_request, arg_accountId, arg_adClientId).then(unittest.expec tAsync(((api.AdUnit response) {
1690 checkAdUnit(response); 1725 checkAdUnit(response);
1691 }))); 1726 })));
1692 }); 1727 });
1693 1728
1694 }); 1729 });
1695 1730
1696 1731
1697 unittest.group("resource-AccountsReportsResourceApi", () { 1732 unittest.group("resource-AccountsReportsResourceApi", () {
1698 unittest.test("method--generate", () { 1733 unittest.test("method--generate", () {
1699 1734
1700 var mock = new common_test.HttpServerMock(); 1735 var mock = new HttpServerMock();
1701 api.AccountsReportsResourceApi res = new api.AdsensehostApi(mock).accounts .reports; 1736 api.AccountsReportsResourceApi res = new api.AdsensehostApi(mock).accounts .reports;
1702 var arg_accountId = "foo"; 1737 var arg_accountId = "foo";
1703 var arg_startDate = "foo"; 1738 var arg_startDate = "foo";
1704 var arg_endDate = "foo"; 1739 var arg_endDate = "foo";
1705 var arg_dimension = buildUnnamed1425(); 1740 var arg_dimension = buildUnnamed178();
1706 var arg_filter = buildUnnamed1426(); 1741 var arg_filter = buildUnnamed179();
1707 var arg_locale = "foo"; 1742 var arg_locale = "foo";
1708 var arg_maxResults = 42; 1743 var arg_maxResults = 42;
1709 var arg_metric = buildUnnamed1427(); 1744 var arg_metric = buildUnnamed180();
1710 var arg_sort = buildUnnamed1428(); 1745 var arg_sort = buildUnnamed181();
1711 var arg_startIndex = 42; 1746 var arg_startIndex = 42;
1712 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 1747 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1713 var path = (req.url).path; 1748 var path = (req.url).path;
1714 var pathOffset = 0; 1749 var pathOffset = 0;
1715 var index; 1750 var index;
1716 var subPart; 1751 var subPart;
1717 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1752 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1718 pathOffset += 1; 1753 pathOffset += 1;
1719 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq uals("adsensehost/v4.1/")); 1754 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq uals("adsensehost/v4.1/"));
1720 pathOffset += 17; 1755 pathOffset += 17;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1752 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e quals(arg_maxResults)); 1787 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e quals(arg_maxResults));
1753 unittest.expect(queryMap["metric"], unittest.equals(arg_metric)); 1788 unittest.expect(queryMap["metric"], unittest.equals(arg_metric));
1754 unittest.expect(queryMap["sort"], unittest.equals(arg_sort)); 1789 unittest.expect(queryMap["sort"], unittest.equals(arg_sort));
1755 unittest.expect(core.int.parse(queryMap["startIndex"].first), unittest.e quals(arg_startIndex)); 1790 unittest.expect(core.int.parse(queryMap["startIndex"].first), unittest.e quals(arg_startIndex));
1756 1791
1757 1792
1758 var h = { 1793 var h = {
1759 "content-type" : "application/json; charset=utf-8", 1794 "content-type" : "application/json; charset=utf-8",
1760 }; 1795 };
1761 var resp = convert.JSON.encode(buildReport()); 1796 var resp = convert.JSON.encode(buildReport());
1762 return new async.Future.value(common_test.stringResponse(200, h, resp)); 1797 return new async.Future.value(stringResponse(200, h, resp));
1763 }), true); 1798 }), true);
1764 res.generate(arg_accountId, arg_startDate, arg_endDate, dimension: arg_dim ension, filter: arg_filter, locale: arg_locale, maxResults: arg_maxResults, metr ic: arg_metric, sort: arg_sort, startIndex: arg_startIndex).then(unittest.expect Async(((api.Report response) { 1799 res.generate(arg_accountId, arg_startDate, arg_endDate, dimension: arg_dim ension, filter: arg_filter, locale: arg_locale, maxResults: arg_maxResults, metr ic: arg_metric, sort: arg_sort, startIndex: arg_startIndex).then(unittest.expect Async(((api.Report response) {
1765 checkReport(response); 1800 checkReport(response);
1766 }))); 1801 })));
1767 }); 1802 });
1768 1803
1769 }); 1804 });
1770 1805
1771 1806
1772 unittest.group("resource-AdclientsResourceApi", () { 1807 unittest.group("resource-AdclientsResourceApi", () {
1773 unittest.test("method--get", () { 1808 unittest.test("method--get", () {
1774 1809
1775 var mock = new common_test.HttpServerMock(); 1810 var mock = new HttpServerMock();
1776 api.AdclientsResourceApi res = new api.AdsensehostApi(mock).adclients; 1811 api.AdclientsResourceApi res = new api.AdsensehostApi(mock).adclients;
1777 var arg_adClientId = "foo"; 1812 var arg_adClientId = "foo";
1778 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 1813 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1779 var path = (req.url).path; 1814 var path = (req.url).path;
1780 var pathOffset = 0; 1815 var pathOffset = 0;
1781 var index; 1816 var index;
1782 var subPart; 1817 var subPart;
1783 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1818 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1784 pathOffset += 1; 1819 pathOffset += 1;
1785 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq uals("adsensehost/v4.1/")); 1820 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq uals("adsensehost/v4.1/"));
(...skipping 19 matching lines...) Expand all
1805 var keyvalue = part.split("="); 1840 var keyvalue = part.split("=");
1806 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1841 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1807 } 1842 }
1808 } 1843 }
1809 1844
1810 1845
1811 var h = { 1846 var h = {
1812 "content-type" : "application/json; charset=utf-8", 1847 "content-type" : "application/json; charset=utf-8",
1813 }; 1848 };
1814 var resp = convert.JSON.encode(buildAdClient()); 1849 var resp = convert.JSON.encode(buildAdClient());
1815 return new async.Future.value(common_test.stringResponse(200, h, resp)); 1850 return new async.Future.value(stringResponse(200, h, resp));
1816 }), true); 1851 }), true);
1817 res.get(arg_adClientId).then(unittest.expectAsync(((api.AdClient response) { 1852 res.get(arg_adClientId).then(unittest.expectAsync(((api.AdClient response) {
1818 checkAdClient(response); 1853 checkAdClient(response);
1819 }))); 1854 })));
1820 }); 1855 });
1821 1856
1822 unittest.test("method--list", () { 1857 unittest.test("method--list", () {
1823 1858
1824 var mock = new common_test.HttpServerMock(); 1859 var mock = new HttpServerMock();
1825 api.AdclientsResourceApi res = new api.AdsensehostApi(mock).adclients; 1860 api.AdclientsResourceApi res = new api.AdsensehostApi(mock).adclients;
1826 var arg_maxResults = 42; 1861 var arg_maxResults = 42;
1827 var arg_pageToken = "foo"; 1862 var arg_pageToken = "foo";
1828 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 1863 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1829 var path = (req.url).path; 1864 var path = (req.url).path;
1830 var pathOffset = 0; 1865 var pathOffset = 0;
1831 var index; 1866 var index;
1832 var subPart; 1867 var subPart;
1833 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1868 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1834 pathOffset += 1; 1869 pathOffset += 1;
(...skipping 19 matching lines...) Expand all
1854 } 1889 }
1855 } 1890 }
1856 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e quals(arg_maxResults)); 1891 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e quals(arg_maxResults));
1857 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en)); 1892 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
1858 1893
1859 1894
1860 var h = { 1895 var h = {
1861 "content-type" : "application/json; charset=utf-8", 1896 "content-type" : "application/json; charset=utf-8",
1862 }; 1897 };
1863 var resp = convert.JSON.encode(buildAdClients()); 1898 var resp = convert.JSON.encode(buildAdClients());
1864 return new async.Future.value(common_test.stringResponse(200, h, resp)); 1899 return new async.Future.value(stringResponse(200, h, resp));
1865 }), true); 1900 }), true);
1866 res.list(maxResults: arg_maxResults, pageToken: arg_pageToken).then(unitte st.expectAsync(((api.AdClients response) { 1901 res.list(maxResults: arg_maxResults, pageToken: arg_pageToken).then(unitte st.expectAsync(((api.AdClients response) {
1867 checkAdClients(response); 1902 checkAdClients(response);
1868 }))); 1903 })));
1869 }); 1904 });
1870 1905
1871 }); 1906 });
1872 1907
1873 1908
1874 unittest.group("resource-AssociationsessionsResourceApi", () { 1909 unittest.group("resource-AssociationsessionsResourceApi", () {
1875 unittest.test("method--start", () { 1910 unittest.test("method--start", () {
1876 1911
1877 var mock = new common_test.HttpServerMock(); 1912 var mock = new HttpServerMock();
1878 api.AssociationsessionsResourceApi res = new api.AdsensehostApi(mock).asso ciationsessions; 1913 api.AssociationsessionsResourceApi res = new api.AdsensehostApi(mock).asso ciationsessions;
1879 var arg_productCode = buildUnnamed1429(); 1914 var arg_productCode = buildUnnamed182();
1880 var arg_websiteUrl = "foo"; 1915 var arg_websiteUrl = "foo";
1881 var arg_userLocale = "foo"; 1916 var arg_userLocale = "foo";
1882 var arg_websiteLocale = "foo"; 1917 var arg_websiteLocale = "foo";
1883 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 1918 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1884 var path = (req.url).path; 1919 var path = (req.url).path;
1885 var pathOffset = 0; 1920 var pathOffset = 0;
1886 var index; 1921 var index;
1887 var subPart; 1922 var subPart;
1888 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1923 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1889 pathOffset += 1; 1924 pathOffset += 1;
(...skipping 21 matching lines...) Expand all
1911 unittest.expect(queryMap["productCode"], unittest.equals(arg_productCode )); 1946 unittest.expect(queryMap["productCode"], unittest.equals(arg_productCode ));
1912 unittest.expect(queryMap["websiteUrl"].first, unittest.equals(arg_websit eUrl)); 1947 unittest.expect(queryMap["websiteUrl"].first, unittest.equals(arg_websit eUrl));
1913 unittest.expect(queryMap["userLocale"].first, unittest.equals(arg_userLo cale)); 1948 unittest.expect(queryMap["userLocale"].first, unittest.equals(arg_userLo cale));
1914 unittest.expect(queryMap["websiteLocale"].first, unittest.equals(arg_web siteLocale)); 1949 unittest.expect(queryMap["websiteLocale"].first, unittest.equals(arg_web siteLocale));
1915 1950
1916 1951
1917 var h = { 1952 var h = {
1918 "content-type" : "application/json; charset=utf-8", 1953 "content-type" : "application/json; charset=utf-8",
1919 }; 1954 };
1920 var resp = convert.JSON.encode(buildAssociationSession()); 1955 var resp = convert.JSON.encode(buildAssociationSession());
1921 return new async.Future.value(common_test.stringResponse(200, h, resp)); 1956 return new async.Future.value(stringResponse(200, h, resp));
1922 }), true); 1957 }), true);
1923 res.start(arg_productCode, arg_websiteUrl, userLocale: arg_userLocale, web siteLocale: arg_websiteLocale).then(unittest.expectAsync(((api.AssociationSessio n response) { 1958 res.start(arg_productCode, arg_websiteUrl, userLocale: arg_userLocale, web siteLocale: arg_websiteLocale).then(unittest.expectAsync(((api.AssociationSessio n response) {
1924 checkAssociationSession(response); 1959 checkAssociationSession(response);
1925 }))); 1960 })));
1926 }); 1961 });
1927 1962
1928 unittest.test("method--verify", () { 1963 unittest.test("method--verify", () {
1929 1964
1930 var mock = new common_test.HttpServerMock(); 1965 var mock = new HttpServerMock();
1931 api.AssociationsessionsResourceApi res = new api.AdsensehostApi(mock).asso ciationsessions; 1966 api.AssociationsessionsResourceApi res = new api.AdsensehostApi(mock).asso ciationsessions;
1932 var arg_token = "foo"; 1967 var arg_token = "foo";
1933 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 1968 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1934 var path = (req.url).path; 1969 var path = (req.url).path;
1935 var pathOffset = 0; 1970 var pathOffset = 0;
1936 var index; 1971 var index;
1937 var subPart; 1972 var subPart;
1938 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1973 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1939 pathOffset += 1; 1974 pathOffset += 1;
1940 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq uals("adsensehost/v4.1/")); 1975 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq uals("adsensehost/v4.1/"));
(...skipping 17 matching lines...) Expand all
1958 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1993 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1959 } 1994 }
1960 } 1995 }
1961 unittest.expect(queryMap["token"].first, unittest.equals(arg_token)); 1996 unittest.expect(queryMap["token"].first, unittest.equals(arg_token));
1962 1997
1963 1998
1964 var h = { 1999 var h = {
1965 "content-type" : "application/json; charset=utf-8", 2000 "content-type" : "application/json; charset=utf-8",
1966 }; 2001 };
1967 var resp = convert.JSON.encode(buildAssociationSession()); 2002 var resp = convert.JSON.encode(buildAssociationSession());
1968 return new async.Future.value(common_test.stringResponse(200, h, resp)); 2003 return new async.Future.value(stringResponse(200, h, resp));
1969 }), true); 2004 }), true);
1970 res.verify(arg_token).then(unittest.expectAsync(((api.AssociationSession r esponse) { 2005 res.verify(arg_token).then(unittest.expectAsync(((api.AssociationSession r esponse) {
1971 checkAssociationSession(response); 2006 checkAssociationSession(response);
1972 }))); 2007 })));
1973 }); 2008 });
1974 2009
1975 }); 2010 });
1976 2011
1977 2012
1978 unittest.group("resource-CustomchannelsResourceApi", () { 2013 unittest.group("resource-CustomchannelsResourceApi", () {
1979 unittest.test("method--delete", () { 2014 unittest.test("method--delete", () {
1980 2015
1981 var mock = new common_test.HttpServerMock(); 2016 var mock = new HttpServerMock();
1982 api.CustomchannelsResourceApi res = new api.AdsensehostApi(mock).customcha nnels; 2017 api.CustomchannelsResourceApi res = new api.AdsensehostApi(mock).customcha nnels;
1983 var arg_adClientId = "foo"; 2018 var arg_adClientId = "foo";
1984 var arg_customChannelId = "foo"; 2019 var arg_customChannelId = "foo";
1985 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 2020 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1986 var path = (req.url).path; 2021 var path = (req.url).path;
1987 var pathOffset = 0; 2022 var pathOffset = 0;
1988 var index; 2023 var index;
1989 var subPart; 2024 var subPart;
1990 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 2025 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1991 pathOffset += 1; 2026 pathOffset += 1;
(...skipping 27 matching lines...) Expand all
2019 var keyvalue = part.split("="); 2054 var keyvalue = part.split("=");
2020 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 2055 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
2021 } 2056 }
2022 } 2057 }
2023 2058
2024 2059
2025 var h = { 2060 var h = {
2026 "content-type" : "application/json; charset=utf-8", 2061 "content-type" : "application/json; charset=utf-8",
2027 }; 2062 };
2028 var resp = convert.JSON.encode(buildCustomChannel()); 2063 var resp = convert.JSON.encode(buildCustomChannel());
2029 return new async.Future.value(common_test.stringResponse(200, h, resp)); 2064 return new async.Future.value(stringResponse(200, h, resp));
2030 }), true); 2065 }), true);
2031 res.delete(arg_adClientId, arg_customChannelId).then(unittest.expectAsync( ((api.CustomChannel response) { 2066 res.delete(arg_adClientId, arg_customChannelId).then(unittest.expectAsync( ((api.CustomChannel response) {
2032 checkCustomChannel(response); 2067 checkCustomChannel(response);
2033 }))); 2068 })));
2034 }); 2069 });
2035 2070
2036 unittest.test("method--get", () { 2071 unittest.test("method--get", () {
2037 2072
2038 var mock = new common_test.HttpServerMock(); 2073 var mock = new HttpServerMock();
2039 api.CustomchannelsResourceApi res = new api.AdsensehostApi(mock).customcha nnels; 2074 api.CustomchannelsResourceApi res = new api.AdsensehostApi(mock).customcha nnels;
2040 var arg_adClientId = "foo"; 2075 var arg_adClientId = "foo";
2041 var arg_customChannelId = "foo"; 2076 var arg_customChannelId = "foo";
2042 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 2077 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
2043 var path = (req.url).path; 2078 var path = (req.url).path;
2044 var pathOffset = 0; 2079 var pathOffset = 0;
2045 var index; 2080 var index;
2046 var subPart; 2081 var subPart;
2047 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 2082 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
2048 pathOffset += 1; 2083 pathOffset += 1;
(...skipping 27 matching lines...) Expand all
2076 var keyvalue = part.split("="); 2111 var keyvalue = part.split("=");
2077 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 2112 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
2078 } 2113 }
2079 } 2114 }
2080 2115
2081 2116
2082 var h = { 2117 var h = {
2083 "content-type" : "application/json; charset=utf-8", 2118 "content-type" : "application/json; charset=utf-8",
2084 }; 2119 };
2085 var resp = convert.JSON.encode(buildCustomChannel()); 2120 var resp = convert.JSON.encode(buildCustomChannel());
2086 return new async.Future.value(common_test.stringResponse(200, h, resp)); 2121 return new async.Future.value(stringResponse(200, h, resp));
2087 }), true); 2122 }), true);
2088 res.get(arg_adClientId, arg_customChannelId).then(unittest.expectAsync(((a pi.CustomChannel response) { 2123 res.get(arg_adClientId, arg_customChannelId).then(unittest.expectAsync(((a pi.CustomChannel response) {
2089 checkCustomChannel(response); 2124 checkCustomChannel(response);
2090 }))); 2125 })));
2091 }); 2126 });
2092 2127
2093 unittest.test("method--insert", () { 2128 unittest.test("method--insert", () {
2094 2129
2095 var mock = new common_test.HttpServerMock(); 2130 var mock = new HttpServerMock();
2096 api.CustomchannelsResourceApi res = new api.AdsensehostApi(mock).customcha nnels; 2131 api.CustomchannelsResourceApi res = new api.AdsensehostApi(mock).customcha nnels;
2097 var arg_request = buildCustomChannel(); 2132 var arg_request = buildCustomChannel();
2098 var arg_adClientId = "foo"; 2133 var arg_adClientId = "foo";
2099 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 2134 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
2100 var obj = new api.CustomChannel.fromJson(json); 2135 var obj = new api.CustomChannel.fromJson(json);
2101 checkCustomChannel(obj); 2136 checkCustomChannel(obj);
2102 2137
2103 var path = (req.url).path; 2138 var path = (req.url).path;
2104 var pathOffset = 0; 2139 var pathOffset = 0;
2105 var index; 2140 var index;
(...skipping 27 matching lines...) Expand all
2133 var keyvalue = part.split("="); 2168 var keyvalue = part.split("=");
2134 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 2169 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
2135 } 2170 }
2136 } 2171 }
2137 2172
2138 2173
2139 var h = { 2174 var h = {
2140 "content-type" : "application/json; charset=utf-8", 2175 "content-type" : "application/json; charset=utf-8",
2141 }; 2176 };
2142 var resp = convert.JSON.encode(buildCustomChannel()); 2177 var resp = convert.JSON.encode(buildCustomChannel());
2143 return new async.Future.value(common_test.stringResponse(200, h, resp)); 2178 return new async.Future.value(stringResponse(200, h, resp));
2144 }), true); 2179 }), true);
2145 res.insert(arg_request, arg_adClientId).then(unittest.expectAsync(((api.Cu stomChannel response) { 2180 res.insert(arg_request, arg_adClientId).then(unittest.expectAsync(((api.Cu stomChannel response) {
2146 checkCustomChannel(response); 2181 checkCustomChannel(response);
2147 }))); 2182 })));
2148 }); 2183 });
2149 2184
2150 unittest.test("method--list", () { 2185 unittest.test("method--list", () {
2151 2186
2152 var mock = new common_test.HttpServerMock(); 2187 var mock = new HttpServerMock();
2153 api.CustomchannelsResourceApi res = new api.AdsensehostApi(mock).customcha nnels; 2188 api.CustomchannelsResourceApi res = new api.AdsensehostApi(mock).customcha nnels;
2154 var arg_adClientId = "foo"; 2189 var arg_adClientId = "foo";
2155 var arg_maxResults = 42; 2190 var arg_maxResults = 42;
2156 var arg_pageToken = "foo"; 2191 var arg_pageToken = "foo";
2157 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 2192 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
2158 var path = (req.url).path; 2193 var path = (req.url).path;
2159 var pathOffset = 0; 2194 var pathOffset = 0;
2160 var index; 2195 var index;
2161 var subPart; 2196 var subPart;
2162 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 2197 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
(...skipping 27 matching lines...) Expand all
2190 } 2225 }
2191 } 2226 }
2192 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e quals(arg_maxResults)); 2227 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e quals(arg_maxResults));
2193 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en)); 2228 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
2194 2229
2195 2230
2196 var h = { 2231 var h = {
2197 "content-type" : "application/json; charset=utf-8", 2232 "content-type" : "application/json; charset=utf-8",
2198 }; 2233 };
2199 var resp = convert.JSON.encode(buildCustomChannels()); 2234 var resp = convert.JSON.encode(buildCustomChannels());
2200 return new async.Future.value(common_test.stringResponse(200, h, resp)); 2235 return new async.Future.value(stringResponse(200, h, resp));
2201 }), true); 2236 }), true);
2202 res.list(arg_adClientId, maxResults: arg_maxResults, pageToken: arg_pageTo ken).then(unittest.expectAsync(((api.CustomChannels response) { 2237 res.list(arg_adClientId, maxResults: arg_maxResults, pageToken: arg_pageTo ken).then(unittest.expectAsync(((api.CustomChannels response) {
2203 checkCustomChannels(response); 2238 checkCustomChannels(response);
2204 }))); 2239 })));
2205 }); 2240 });
2206 2241
2207 unittest.test("method--patch", () { 2242 unittest.test("method--patch", () {
2208 2243
2209 var mock = new common_test.HttpServerMock(); 2244 var mock = new HttpServerMock();
2210 api.CustomchannelsResourceApi res = new api.AdsensehostApi(mock).customcha nnels; 2245 api.CustomchannelsResourceApi res = new api.AdsensehostApi(mock).customcha nnels;
2211 var arg_request = buildCustomChannel(); 2246 var arg_request = buildCustomChannel();
2212 var arg_adClientId = "foo"; 2247 var arg_adClientId = "foo";
2213 var arg_customChannelId = "foo"; 2248 var arg_customChannelId = "foo";
2214 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 2249 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
2215 var obj = new api.CustomChannel.fromJson(json); 2250 var obj = new api.CustomChannel.fromJson(json);
2216 checkCustomChannel(obj); 2251 checkCustomChannel(obj);
2217 2252
2218 var path = (req.url).path; 2253 var path = (req.url).path;
2219 var pathOffset = 0; 2254 var pathOffset = 0;
(...skipping 29 matching lines...) Expand all
2249 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 2284 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
2250 } 2285 }
2251 } 2286 }
2252 unittest.expect(queryMap["customChannelId"].first, unittest.equals(arg_c ustomChannelId)); 2287 unittest.expect(queryMap["customChannelId"].first, unittest.equals(arg_c ustomChannelId));
2253 2288
2254 2289
2255 var h = { 2290 var h = {
2256 "content-type" : "application/json; charset=utf-8", 2291 "content-type" : "application/json; charset=utf-8",
2257 }; 2292 };
2258 var resp = convert.JSON.encode(buildCustomChannel()); 2293 var resp = convert.JSON.encode(buildCustomChannel());
2259 return new async.Future.value(common_test.stringResponse(200, h, resp)); 2294 return new async.Future.value(stringResponse(200, h, resp));
2260 }), true); 2295 }), true);
2261 res.patch(arg_request, arg_adClientId, arg_customChannelId).then(unittest. expectAsync(((api.CustomChannel response) { 2296 res.patch(arg_request, arg_adClientId, arg_customChannelId).then(unittest. expectAsync(((api.CustomChannel response) {
2262 checkCustomChannel(response); 2297 checkCustomChannel(response);
2263 }))); 2298 })));
2264 }); 2299 });
2265 2300
2266 unittest.test("method--update", () { 2301 unittest.test("method--update", () {
2267 2302
2268 var mock = new common_test.HttpServerMock(); 2303 var mock = new HttpServerMock();
2269 api.CustomchannelsResourceApi res = new api.AdsensehostApi(mock).customcha nnels; 2304 api.CustomchannelsResourceApi res = new api.AdsensehostApi(mock).customcha nnels;
2270 var arg_request = buildCustomChannel(); 2305 var arg_request = buildCustomChannel();
2271 var arg_adClientId = "foo"; 2306 var arg_adClientId = "foo";
2272 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 2307 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
2273 var obj = new api.CustomChannel.fromJson(json); 2308 var obj = new api.CustomChannel.fromJson(json);
2274 checkCustomChannel(obj); 2309 checkCustomChannel(obj);
2275 2310
2276 var path = (req.url).path; 2311 var path = (req.url).path;
2277 var pathOffset = 0; 2312 var pathOffset = 0;
2278 var index; 2313 var index;
(...skipping 27 matching lines...) Expand all
2306 var keyvalue = part.split("="); 2341 var keyvalue = part.split("=");
2307 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 2342 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
2308 } 2343 }
2309 } 2344 }
2310 2345
2311 2346
2312 var h = { 2347 var h = {
2313 "content-type" : "application/json; charset=utf-8", 2348 "content-type" : "application/json; charset=utf-8",
2314 }; 2349 };
2315 var resp = convert.JSON.encode(buildCustomChannel()); 2350 var resp = convert.JSON.encode(buildCustomChannel());
2316 return new async.Future.value(common_test.stringResponse(200, h, resp)); 2351 return new async.Future.value(stringResponse(200, h, resp));
2317 }), true); 2352 }), true);
2318 res.update(arg_request, arg_adClientId).then(unittest.expectAsync(((api.Cu stomChannel response) { 2353 res.update(arg_request, arg_adClientId).then(unittest.expectAsync(((api.Cu stomChannel response) {
2319 checkCustomChannel(response); 2354 checkCustomChannel(response);
2320 }))); 2355 })));
2321 }); 2356 });
2322 2357
2323 }); 2358 });
2324 2359
2325 2360
2326 unittest.group("resource-ReportsResourceApi", () { 2361 unittest.group("resource-ReportsResourceApi", () {
2327 unittest.test("method--generate", () { 2362 unittest.test("method--generate", () {
2328 2363
2329 var mock = new common_test.HttpServerMock(); 2364 var mock = new HttpServerMock();
2330 api.ReportsResourceApi res = new api.AdsensehostApi(mock).reports; 2365 api.ReportsResourceApi res = new api.AdsensehostApi(mock).reports;
2331 var arg_startDate = "foo"; 2366 var arg_startDate = "foo";
2332 var arg_endDate = "foo"; 2367 var arg_endDate = "foo";
2333 var arg_dimension = buildUnnamed1430(); 2368 var arg_dimension = buildUnnamed183();
2334 var arg_filter = buildUnnamed1431(); 2369 var arg_filter = buildUnnamed184();
2335 var arg_locale = "foo"; 2370 var arg_locale = "foo";
2336 var arg_maxResults = 42; 2371 var arg_maxResults = 42;
2337 var arg_metric = buildUnnamed1432(); 2372 var arg_metric = buildUnnamed185();
2338 var arg_sort = buildUnnamed1433(); 2373 var arg_sort = buildUnnamed186();
2339 var arg_startIndex = 42; 2374 var arg_startIndex = 42;
2340 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 2375 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
2341 var path = (req.url).path; 2376 var path = (req.url).path;
2342 var pathOffset = 0; 2377 var pathOffset = 0;
2343 var index; 2378 var index;
2344 var subPart; 2379 var subPart;
2345 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 2380 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
2346 pathOffset += 1; 2381 pathOffset += 1;
2347 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq uals("adsensehost/v4.1/")); 2382 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq uals("adsensehost/v4.1/"));
2348 pathOffset += 17; 2383 pathOffset += 17;
(...skipping 24 matching lines...) Expand all
2373 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e quals(arg_maxResults)); 2408 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e quals(arg_maxResults));
2374 unittest.expect(queryMap["metric"], unittest.equals(arg_metric)); 2409 unittest.expect(queryMap["metric"], unittest.equals(arg_metric));
2375 unittest.expect(queryMap["sort"], unittest.equals(arg_sort)); 2410 unittest.expect(queryMap["sort"], unittest.equals(arg_sort));
2376 unittest.expect(core.int.parse(queryMap["startIndex"].first), unittest.e quals(arg_startIndex)); 2411 unittest.expect(core.int.parse(queryMap["startIndex"].first), unittest.e quals(arg_startIndex));
2377 2412
2378 2413
2379 var h = { 2414 var h = {
2380 "content-type" : "application/json; charset=utf-8", 2415 "content-type" : "application/json; charset=utf-8",
2381 }; 2416 };
2382 var resp = convert.JSON.encode(buildReport()); 2417 var resp = convert.JSON.encode(buildReport());
2383 return new async.Future.value(common_test.stringResponse(200, h, resp)); 2418 return new async.Future.value(stringResponse(200, h, resp));
2384 }), true); 2419 }), true);
2385 res.generate(arg_startDate, arg_endDate, dimension: arg_dimension, filter: arg_filter, locale: arg_locale, maxResults: arg_maxResults, metric: arg_metric, sort: arg_sort, startIndex: arg_startIndex).then(unittest.expectAsync(((api.Rep ort response) { 2420 res.generate(arg_startDate, arg_endDate, dimension: arg_dimension, filter: arg_filter, locale: arg_locale, maxResults: arg_maxResults, metric: arg_metric, sort: arg_sort, startIndex: arg_startIndex).then(unittest.expectAsync(((api.Rep ort response) {
2386 checkReport(response); 2421 checkReport(response);
2387 }))); 2422 })));
2388 }); 2423 });
2389 2424
2390 }); 2425 });
2391 2426
2392 2427
2393 unittest.group("resource-UrlchannelsResourceApi", () { 2428 unittest.group("resource-UrlchannelsResourceApi", () {
2394 unittest.test("method--delete", () { 2429 unittest.test("method--delete", () {
2395 2430
2396 var mock = new common_test.HttpServerMock(); 2431 var mock = new HttpServerMock();
2397 api.UrlchannelsResourceApi res = new api.AdsensehostApi(mock).urlchannels; 2432 api.UrlchannelsResourceApi res = new api.AdsensehostApi(mock).urlchannels;
2398 var arg_adClientId = "foo"; 2433 var arg_adClientId = "foo";
2399 var arg_urlChannelId = "foo"; 2434 var arg_urlChannelId = "foo";
2400 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 2435 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
2401 var path = (req.url).path; 2436 var path = (req.url).path;
2402 var pathOffset = 0; 2437 var pathOffset = 0;
2403 var index; 2438 var index;
2404 var subPart; 2439 var subPart;
2405 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 2440 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
2406 pathOffset += 1; 2441 pathOffset += 1;
(...skipping 27 matching lines...) Expand all
2434 var keyvalue = part.split("="); 2469 var keyvalue = part.split("=");
2435 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 2470 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
2436 } 2471 }
2437 } 2472 }
2438 2473
2439 2474
2440 var h = { 2475 var h = {
2441 "content-type" : "application/json; charset=utf-8", 2476 "content-type" : "application/json; charset=utf-8",
2442 }; 2477 };
2443 var resp = convert.JSON.encode(buildUrlChannel()); 2478 var resp = convert.JSON.encode(buildUrlChannel());
2444 return new async.Future.value(common_test.stringResponse(200, h, resp)); 2479 return new async.Future.value(stringResponse(200, h, resp));
2445 }), true); 2480 }), true);
2446 res.delete(arg_adClientId, arg_urlChannelId).then(unittest.expectAsync(((a pi.UrlChannel response) { 2481 res.delete(arg_adClientId, arg_urlChannelId).then(unittest.expectAsync(((a pi.UrlChannel response) {
2447 checkUrlChannel(response); 2482 checkUrlChannel(response);
2448 }))); 2483 })));
2449 }); 2484 });
2450 2485
2451 unittest.test("method--insert", () { 2486 unittest.test("method--insert", () {
2452 2487
2453 var mock = new common_test.HttpServerMock(); 2488 var mock = new HttpServerMock();
2454 api.UrlchannelsResourceApi res = new api.AdsensehostApi(mock).urlchannels; 2489 api.UrlchannelsResourceApi res = new api.AdsensehostApi(mock).urlchannels;
2455 var arg_request = buildUrlChannel(); 2490 var arg_request = buildUrlChannel();
2456 var arg_adClientId = "foo"; 2491 var arg_adClientId = "foo";
2457 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 2492 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
2458 var obj = new api.UrlChannel.fromJson(json); 2493 var obj = new api.UrlChannel.fromJson(json);
2459 checkUrlChannel(obj); 2494 checkUrlChannel(obj);
2460 2495
2461 var path = (req.url).path; 2496 var path = (req.url).path;
2462 var pathOffset = 0; 2497 var pathOffset = 0;
2463 var index; 2498 var index;
(...skipping 27 matching lines...) Expand all
2491 var keyvalue = part.split("="); 2526 var keyvalue = part.split("=");
2492 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 2527 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
2493 } 2528 }
2494 } 2529 }
2495 2530
2496 2531
2497 var h = { 2532 var h = {
2498 "content-type" : "application/json; charset=utf-8", 2533 "content-type" : "application/json; charset=utf-8",
2499 }; 2534 };
2500 var resp = convert.JSON.encode(buildUrlChannel()); 2535 var resp = convert.JSON.encode(buildUrlChannel());
2501 return new async.Future.value(common_test.stringResponse(200, h, resp)); 2536 return new async.Future.value(stringResponse(200, h, resp));
2502 }), true); 2537 }), true);
2503 res.insert(arg_request, arg_adClientId).then(unittest.expectAsync(((api.Ur lChannel response) { 2538 res.insert(arg_request, arg_adClientId).then(unittest.expectAsync(((api.Ur lChannel response) {
2504 checkUrlChannel(response); 2539 checkUrlChannel(response);
2505 }))); 2540 })));
2506 }); 2541 });
2507 2542
2508 unittest.test("method--list", () { 2543 unittest.test("method--list", () {
2509 2544
2510 var mock = new common_test.HttpServerMock(); 2545 var mock = new HttpServerMock();
2511 api.UrlchannelsResourceApi res = new api.AdsensehostApi(mock).urlchannels; 2546 api.UrlchannelsResourceApi res = new api.AdsensehostApi(mock).urlchannels;
2512 var arg_adClientId = "foo"; 2547 var arg_adClientId = "foo";
2513 var arg_maxResults = 42; 2548 var arg_maxResults = 42;
2514 var arg_pageToken = "foo"; 2549 var arg_pageToken = "foo";
2515 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 2550 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
2516 var path = (req.url).path; 2551 var path = (req.url).path;
2517 var pathOffset = 0; 2552 var pathOffset = 0;
2518 var index; 2553 var index;
2519 var subPart; 2554 var subPart;
2520 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 2555 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
(...skipping 27 matching lines...) Expand all
2548 } 2583 }
2549 } 2584 }
2550 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e quals(arg_maxResults)); 2585 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e quals(arg_maxResults));
2551 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en)); 2586 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
2552 2587
2553 2588
2554 var h = { 2589 var h = {
2555 "content-type" : "application/json; charset=utf-8", 2590 "content-type" : "application/json; charset=utf-8",
2556 }; 2591 };
2557 var resp = convert.JSON.encode(buildUrlChannels()); 2592 var resp = convert.JSON.encode(buildUrlChannels());
2558 return new async.Future.value(common_test.stringResponse(200, h, resp)); 2593 return new async.Future.value(stringResponse(200, h, resp));
2559 }), true); 2594 }), true);
2560 res.list(arg_adClientId, maxResults: arg_maxResults, pageToken: arg_pageTo ken).then(unittest.expectAsync(((api.UrlChannels response) { 2595 res.list(arg_adClientId, maxResults: arg_maxResults, pageToken: arg_pageTo ken).then(unittest.expectAsync(((api.UrlChannels response) {
2561 checkUrlChannels(response); 2596 checkUrlChannels(response);
2562 }))); 2597 })));
2563 }); 2598 });
2564 2599
2565 }); 2600 });
2566 2601
2567 2602
2568 } 2603 }
2569 2604
OLDNEW
« no previous file with comments | « generated/googleapis/test/adsense/v1_4_test.dart ('k') | generated/googleapis/test/analytics/v3_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698