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

Side by Side Diff: generated/googleapis/test/plus/v1.dart

Issue 559053002: Generate 0.1.0 version of googleapis/googleapis_beta (Closed) Base URL: git@github.com:dart-lang/googleapis.git@master
Patch Set: Created 6 years, 3 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
(Empty)
1 library googleapis.plus.v1.test;
2
3 import "dart:core" as core;
4 import "dart:collection" as collection;
5 import "dart:async" as async;
6 import "dart:convert" as convert;
7
8 import 'package:http/http.dart' as http;
9 import 'package:http/testing.dart' as http_testing;
10 import 'package:unittest/unittest.dart' as unittest;
11 import 'package:googleapis/common/common.dart' as common;
12 import 'package:googleapis/src/common_internal.dart' as common_internal;
13 import '../common/common_internal_test.dart' as common_test;
14
15 import 'package:googleapis/plus/v1.dart' as api;
16
17
18
19 buildUnnamed167() {
20 var o = new core.List<api.PlusAclentryResource>();
21 o.add(buildPlusAclentryResource());
22 o.add(buildPlusAclentryResource());
23 return o;
24 }
25
26 checkUnnamed167(core.List<api.PlusAclentryResource> o) {
27 unittest.expect(o, unittest.hasLength(2));
28 checkPlusAclentryResource(o[0]);
29 checkPlusAclentryResource(o[1]);
30 }
31
32 core.int buildCounterAcl = 0;
33 buildAcl() {
34 var o = new api.Acl();
35 buildCounterAcl++;
36 if (buildCounterAcl < 3) {
37 o.description = "foo";
38 o.items = buildUnnamed167();
39 o.kind = "foo";
40 }
41 buildCounterAcl--;
42 return o;
43 }
44
45 checkAcl(api.Acl o) {
46 buildCounterAcl++;
47 if (buildCounterAcl < 3) {
48 unittest.expect(o.description, unittest.equals('foo'));
49 checkUnnamed167(o.items);
50 unittest.expect(o.kind, unittest.equals('foo'));
51 }
52 buildCounterAcl--;
53 }
54
55 core.int buildCounterActivityActorImage = 0;
56 buildActivityActorImage() {
57 var o = new api.ActivityActorImage();
58 buildCounterActivityActorImage++;
59 if (buildCounterActivityActorImage < 3) {
60 o.url = "foo";
61 }
62 buildCounterActivityActorImage--;
63 return o;
64 }
65
66 checkActivityActorImage(api.ActivityActorImage o) {
67 buildCounterActivityActorImage++;
68 if (buildCounterActivityActorImage < 3) {
69 unittest.expect(o.url, unittest.equals('foo'));
70 }
71 buildCounterActivityActorImage--;
72 }
73
74 core.int buildCounterActivityActorName = 0;
75 buildActivityActorName() {
76 var o = new api.ActivityActorName();
77 buildCounterActivityActorName++;
78 if (buildCounterActivityActorName < 3) {
79 o.familyName = "foo";
80 o.givenName = "foo";
81 }
82 buildCounterActivityActorName--;
83 return o;
84 }
85
86 checkActivityActorName(api.ActivityActorName o) {
87 buildCounterActivityActorName++;
88 if (buildCounterActivityActorName < 3) {
89 unittest.expect(o.familyName, unittest.equals('foo'));
90 unittest.expect(o.givenName, unittest.equals('foo'));
91 }
92 buildCounterActivityActorName--;
93 }
94
95 core.int buildCounterActivityActor = 0;
96 buildActivityActor() {
97 var o = new api.ActivityActor();
98 buildCounterActivityActor++;
99 if (buildCounterActivityActor < 3) {
100 o.displayName = "foo";
101 o.id = "foo";
102 o.image = buildActivityActorImage();
103 o.name = buildActivityActorName();
104 o.url = "foo";
105 }
106 buildCounterActivityActor--;
107 return o;
108 }
109
110 checkActivityActor(api.ActivityActor o) {
111 buildCounterActivityActor++;
112 if (buildCounterActivityActor < 3) {
113 unittest.expect(o.displayName, unittest.equals('foo'));
114 unittest.expect(o.id, unittest.equals('foo'));
115 checkActivityActorImage(o.image);
116 checkActivityActorName(o.name);
117 unittest.expect(o.url, unittest.equals('foo'));
118 }
119 buildCounterActivityActor--;
120 }
121
122 core.int buildCounterActivityObjectActorImage = 0;
123 buildActivityObjectActorImage() {
124 var o = new api.ActivityObjectActorImage();
125 buildCounterActivityObjectActorImage++;
126 if (buildCounterActivityObjectActorImage < 3) {
127 o.url = "foo";
128 }
129 buildCounterActivityObjectActorImage--;
130 return o;
131 }
132
133 checkActivityObjectActorImage(api.ActivityObjectActorImage o) {
134 buildCounterActivityObjectActorImage++;
135 if (buildCounterActivityObjectActorImage < 3) {
136 unittest.expect(o.url, unittest.equals('foo'));
137 }
138 buildCounterActivityObjectActorImage--;
139 }
140
141 core.int buildCounterActivityObjectActor = 0;
142 buildActivityObjectActor() {
143 var o = new api.ActivityObjectActor();
144 buildCounterActivityObjectActor++;
145 if (buildCounterActivityObjectActor < 3) {
146 o.displayName = "foo";
147 o.id = "foo";
148 o.image = buildActivityObjectActorImage();
149 o.url = "foo";
150 }
151 buildCounterActivityObjectActor--;
152 return o;
153 }
154
155 checkActivityObjectActor(api.ActivityObjectActor o) {
156 buildCounterActivityObjectActor++;
157 if (buildCounterActivityObjectActor < 3) {
158 unittest.expect(o.displayName, unittest.equals('foo'));
159 unittest.expect(o.id, unittest.equals('foo'));
160 checkActivityObjectActorImage(o.image);
161 unittest.expect(o.url, unittest.equals('foo'));
162 }
163 buildCounterActivityObjectActor--;
164 }
165
166 core.int buildCounterActivityObjectAttachmentsEmbed = 0;
167 buildActivityObjectAttachmentsEmbed() {
168 var o = new api.ActivityObjectAttachmentsEmbed();
169 buildCounterActivityObjectAttachmentsEmbed++;
170 if (buildCounterActivityObjectAttachmentsEmbed < 3) {
171 o.type = "foo";
172 o.url = "foo";
173 }
174 buildCounterActivityObjectAttachmentsEmbed--;
175 return o;
176 }
177
178 checkActivityObjectAttachmentsEmbed(api.ActivityObjectAttachmentsEmbed o) {
179 buildCounterActivityObjectAttachmentsEmbed++;
180 if (buildCounterActivityObjectAttachmentsEmbed < 3) {
181 unittest.expect(o.type, unittest.equals('foo'));
182 unittest.expect(o.url, unittest.equals('foo'));
183 }
184 buildCounterActivityObjectAttachmentsEmbed--;
185 }
186
187 core.int buildCounterActivityObjectAttachmentsFullImage = 0;
188 buildActivityObjectAttachmentsFullImage() {
189 var o = new api.ActivityObjectAttachmentsFullImage();
190 buildCounterActivityObjectAttachmentsFullImage++;
191 if (buildCounterActivityObjectAttachmentsFullImage < 3) {
192 o.height = 42;
193 o.type = "foo";
194 o.url = "foo";
195 o.width = 42;
196 }
197 buildCounterActivityObjectAttachmentsFullImage--;
198 return o;
199 }
200
201 checkActivityObjectAttachmentsFullImage(api.ActivityObjectAttachmentsFullImage o ) {
202 buildCounterActivityObjectAttachmentsFullImage++;
203 if (buildCounterActivityObjectAttachmentsFullImage < 3) {
204 unittest.expect(o.height, unittest.equals(42));
205 unittest.expect(o.type, unittest.equals('foo'));
206 unittest.expect(o.url, unittest.equals('foo'));
207 unittest.expect(o.width, unittest.equals(42));
208 }
209 buildCounterActivityObjectAttachmentsFullImage--;
210 }
211
212 core.int buildCounterActivityObjectAttachmentsImage = 0;
213 buildActivityObjectAttachmentsImage() {
214 var o = new api.ActivityObjectAttachmentsImage();
215 buildCounterActivityObjectAttachmentsImage++;
216 if (buildCounterActivityObjectAttachmentsImage < 3) {
217 o.height = 42;
218 o.type = "foo";
219 o.url = "foo";
220 o.width = 42;
221 }
222 buildCounterActivityObjectAttachmentsImage--;
223 return o;
224 }
225
226 checkActivityObjectAttachmentsImage(api.ActivityObjectAttachmentsImage o) {
227 buildCounterActivityObjectAttachmentsImage++;
228 if (buildCounterActivityObjectAttachmentsImage < 3) {
229 unittest.expect(o.height, unittest.equals(42));
230 unittest.expect(o.type, unittest.equals('foo'));
231 unittest.expect(o.url, unittest.equals('foo'));
232 unittest.expect(o.width, unittest.equals(42));
233 }
234 buildCounterActivityObjectAttachmentsImage--;
235 }
236
237 core.int buildCounterActivityObjectAttachmentsThumbnailsImage = 0;
238 buildActivityObjectAttachmentsThumbnailsImage() {
239 var o = new api.ActivityObjectAttachmentsThumbnailsImage();
240 buildCounterActivityObjectAttachmentsThumbnailsImage++;
241 if (buildCounterActivityObjectAttachmentsThumbnailsImage < 3) {
242 o.height = 42;
243 o.type = "foo";
244 o.url = "foo";
245 o.width = 42;
246 }
247 buildCounterActivityObjectAttachmentsThumbnailsImage--;
248 return o;
249 }
250
251 checkActivityObjectAttachmentsThumbnailsImage(api.ActivityObjectAttachmentsThumb nailsImage o) {
252 buildCounterActivityObjectAttachmentsThumbnailsImage++;
253 if (buildCounterActivityObjectAttachmentsThumbnailsImage < 3) {
254 unittest.expect(o.height, unittest.equals(42));
255 unittest.expect(o.type, unittest.equals('foo'));
256 unittest.expect(o.url, unittest.equals('foo'));
257 unittest.expect(o.width, unittest.equals(42));
258 }
259 buildCounterActivityObjectAttachmentsThumbnailsImage--;
260 }
261
262 core.int buildCounterActivityObjectAttachmentsThumbnails = 0;
263 buildActivityObjectAttachmentsThumbnails() {
264 var o = new api.ActivityObjectAttachmentsThumbnails();
265 buildCounterActivityObjectAttachmentsThumbnails++;
266 if (buildCounterActivityObjectAttachmentsThumbnails < 3) {
267 o.description = "foo";
268 o.image = buildActivityObjectAttachmentsThumbnailsImage();
269 o.url = "foo";
270 }
271 buildCounterActivityObjectAttachmentsThumbnails--;
272 return o;
273 }
274
275 checkActivityObjectAttachmentsThumbnails(api.ActivityObjectAttachmentsThumbnails o) {
276 buildCounterActivityObjectAttachmentsThumbnails++;
277 if (buildCounterActivityObjectAttachmentsThumbnails < 3) {
278 unittest.expect(o.description, unittest.equals('foo'));
279 checkActivityObjectAttachmentsThumbnailsImage(o.image);
280 unittest.expect(o.url, unittest.equals('foo'));
281 }
282 buildCounterActivityObjectAttachmentsThumbnails--;
283 }
284
285 buildUnnamed168() {
286 var o = new core.List<api.ActivityObjectAttachmentsThumbnails>();
287 o.add(buildActivityObjectAttachmentsThumbnails());
288 o.add(buildActivityObjectAttachmentsThumbnails());
289 return o;
290 }
291
292 checkUnnamed168(core.List<api.ActivityObjectAttachmentsThumbnails> o) {
293 unittest.expect(o, unittest.hasLength(2));
294 checkActivityObjectAttachmentsThumbnails(o[0]);
295 checkActivityObjectAttachmentsThumbnails(o[1]);
296 }
297
298 core.int buildCounterActivityObjectAttachments = 0;
299 buildActivityObjectAttachments() {
300 var o = new api.ActivityObjectAttachments();
301 buildCounterActivityObjectAttachments++;
302 if (buildCounterActivityObjectAttachments < 3) {
303 o.content = "foo";
304 o.displayName = "foo";
305 o.embed = buildActivityObjectAttachmentsEmbed();
306 o.fullImage = buildActivityObjectAttachmentsFullImage();
307 o.id = "foo";
308 o.image = buildActivityObjectAttachmentsImage();
309 o.objectType = "foo";
310 o.thumbnails = buildUnnamed168();
311 o.url = "foo";
312 }
313 buildCounterActivityObjectAttachments--;
314 return o;
315 }
316
317 checkActivityObjectAttachments(api.ActivityObjectAttachments o) {
318 buildCounterActivityObjectAttachments++;
319 if (buildCounterActivityObjectAttachments < 3) {
320 unittest.expect(o.content, unittest.equals('foo'));
321 unittest.expect(o.displayName, unittest.equals('foo'));
322 checkActivityObjectAttachmentsEmbed(o.embed);
323 checkActivityObjectAttachmentsFullImage(o.fullImage);
324 unittest.expect(o.id, unittest.equals('foo'));
325 checkActivityObjectAttachmentsImage(o.image);
326 unittest.expect(o.objectType, unittest.equals('foo'));
327 checkUnnamed168(o.thumbnails);
328 unittest.expect(o.url, unittest.equals('foo'));
329 }
330 buildCounterActivityObjectAttachments--;
331 }
332
333 buildUnnamed169() {
334 var o = new core.List<api.ActivityObjectAttachments>();
335 o.add(buildActivityObjectAttachments());
336 o.add(buildActivityObjectAttachments());
337 return o;
338 }
339
340 checkUnnamed169(core.List<api.ActivityObjectAttachments> o) {
341 unittest.expect(o, unittest.hasLength(2));
342 checkActivityObjectAttachments(o[0]);
343 checkActivityObjectAttachments(o[1]);
344 }
345
346 core.int buildCounterActivityObjectPlusoners = 0;
347 buildActivityObjectPlusoners() {
348 var o = new api.ActivityObjectPlusoners();
349 buildCounterActivityObjectPlusoners++;
350 if (buildCounterActivityObjectPlusoners < 3) {
351 o.selfLink = "foo";
352 o.totalItems = 42;
353 }
354 buildCounterActivityObjectPlusoners--;
355 return o;
356 }
357
358 checkActivityObjectPlusoners(api.ActivityObjectPlusoners o) {
359 buildCounterActivityObjectPlusoners++;
360 if (buildCounterActivityObjectPlusoners < 3) {
361 unittest.expect(o.selfLink, unittest.equals('foo'));
362 unittest.expect(o.totalItems, unittest.equals(42));
363 }
364 buildCounterActivityObjectPlusoners--;
365 }
366
367 core.int buildCounterActivityObjectReplies = 0;
368 buildActivityObjectReplies() {
369 var o = new api.ActivityObjectReplies();
370 buildCounterActivityObjectReplies++;
371 if (buildCounterActivityObjectReplies < 3) {
372 o.selfLink = "foo";
373 o.totalItems = 42;
374 }
375 buildCounterActivityObjectReplies--;
376 return o;
377 }
378
379 checkActivityObjectReplies(api.ActivityObjectReplies o) {
380 buildCounterActivityObjectReplies++;
381 if (buildCounterActivityObjectReplies < 3) {
382 unittest.expect(o.selfLink, unittest.equals('foo'));
383 unittest.expect(o.totalItems, unittest.equals(42));
384 }
385 buildCounterActivityObjectReplies--;
386 }
387
388 core.int buildCounterActivityObjectResharers = 0;
389 buildActivityObjectResharers() {
390 var o = new api.ActivityObjectResharers();
391 buildCounterActivityObjectResharers++;
392 if (buildCounterActivityObjectResharers < 3) {
393 o.selfLink = "foo";
394 o.totalItems = 42;
395 }
396 buildCounterActivityObjectResharers--;
397 return o;
398 }
399
400 checkActivityObjectResharers(api.ActivityObjectResharers o) {
401 buildCounterActivityObjectResharers++;
402 if (buildCounterActivityObjectResharers < 3) {
403 unittest.expect(o.selfLink, unittest.equals('foo'));
404 unittest.expect(o.totalItems, unittest.equals(42));
405 }
406 buildCounterActivityObjectResharers--;
407 }
408
409 core.int buildCounterActivityObject = 0;
410 buildActivityObject() {
411 var o = new api.ActivityObject();
412 buildCounterActivityObject++;
413 if (buildCounterActivityObject < 3) {
414 o.actor = buildActivityObjectActor();
415 o.attachments = buildUnnamed169();
416 o.content = "foo";
417 o.id = "foo";
418 o.objectType = "foo";
419 o.originalContent = "foo";
420 o.plusoners = buildActivityObjectPlusoners();
421 o.replies = buildActivityObjectReplies();
422 o.resharers = buildActivityObjectResharers();
423 o.url = "foo";
424 }
425 buildCounterActivityObject--;
426 return o;
427 }
428
429 checkActivityObject(api.ActivityObject o) {
430 buildCounterActivityObject++;
431 if (buildCounterActivityObject < 3) {
432 checkActivityObjectActor(o.actor);
433 checkUnnamed169(o.attachments);
434 unittest.expect(o.content, unittest.equals('foo'));
435 unittest.expect(o.id, unittest.equals('foo'));
436 unittest.expect(o.objectType, unittest.equals('foo'));
437 unittest.expect(o.originalContent, unittest.equals('foo'));
438 checkActivityObjectPlusoners(o.plusoners);
439 checkActivityObjectReplies(o.replies);
440 checkActivityObjectResharers(o.resharers);
441 unittest.expect(o.url, unittest.equals('foo'));
442 }
443 buildCounterActivityObject--;
444 }
445
446 core.int buildCounterActivityProvider = 0;
447 buildActivityProvider() {
448 var o = new api.ActivityProvider();
449 buildCounterActivityProvider++;
450 if (buildCounterActivityProvider < 3) {
451 o.title = "foo";
452 }
453 buildCounterActivityProvider--;
454 return o;
455 }
456
457 checkActivityProvider(api.ActivityProvider o) {
458 buildCounterActivityProvider++;
459 if (buildCounterActivityProvider < 3) {
460 unittest.expect(o.title, unittest.equals('foo'));
461 }
462 buildCounterActivityProvider--;
463 }
464
465 core.int buildCounterActivity = 0;
466 buildActivity() {
467 var o = new api.Activity();
468 buildCounterActivity++;
469 if (buildCounterActivity < 3) {
470 o.access = buildAcl();
471 o.actor = buildActivityActor();
472 o.address = "foo";
473 o.annotation = "foo";
474 o.crosspostSource = "foo";
475 o.etag = "foo";
476 o.geocode = "foo";
477 o.id = "foo";
478 o.kind = "foo";
479 o.location = buildPlace();
480 o.object = buildActivityObject();
481 o.placeId = "foo";
482 o.placeName = "foo";
483 o.provider = buildActivityProvider();
484 o.published = core.DateTime.parse("2002-02-27T14:01:02");
485 o.radius = "foo";
486 o.title = "foo";
487 o.updated = core.DateTime.parse("2002-02-27T14:01:02");
488 o.url = "foo";
489 o.verb = "foo";
490 }
491 buildCounterActivity--;
492 return o;
493 }
494
495 checkActivity(api.Activity o) {
496 buildCounterActivity++;
497 if (buildCounterActivity < 3) {
498 checkAcl(o.access);
499 checkActivityActor(o.actor);
500 unittest.expect(o.address, unittest.equals('foo'));
501 unittest.expect(o.annotation, unittest.equals('foo'));
502 unittest.expect(o.crosspostSource, unittest.equals('foo'));
503 unittest.expect(o.etag, unittest.equals('foo'));
504 unittest.expect(o.geocode, unittest.equals('foo'));
505 unittest.expect(o.id, unittest.equals('foo'));
506 unittest.expect(o.kind, unittest.equals('foo'));
507 checkPlace(o.location);
508 checkActivityObject(o.object);
509 unittest.expect(o.placeId, unittest.equals('foo'));
510 unittest.expect(o.placeName, unittest.equals('foo'));
511 checkActivityProvider(o.provider);
512 unittest.expect(o.published, unittest.equals(core.DateTime.parse("2002-02-27 T14:01:02")));
513 unittest.expect(o.radius, unittest.equals('foo'));
514 unittest.expect(o.title, unittest.equals('foo'));
515 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1 4:01:02")));
516 unittest.expect(o.url, unittest.equals('foo'));
517 unittest.expect(o.verb, unittest.equals('foo'));
518 }
519 buildCounterActivity--;
520 }
521
522 buildUnnamed170() {
523 var o = new core.List<api.Activity>();
524 o.add(buildActivity());
525 o.add(buildActivity());
526 return o;
527 }
528
529 checkUnnamed170(core.List<api.Activity> o) {
530 unittest.expect(o, unittest.hasLength(2));
531 checkActivity(o[0]);
532 checkActivity(o[1]);
533 }
534
535 core.int buildCounterActivityFeed = 0;
536 buildActivityFeed() {
537 var o = new api.ActivityFeed();
538 buildCounterActivityFeed++;
539 if (buildCounterActivityFeed < 3) {
540 o.etag = "foo";
541 o.id = "foo";
542 o.items = buildUnnamed170();
543 o.kind = "foo";
544 o.nextLink = "foo";
545 o.nextPageToken = "foo";
546 o.selfLink = "foo";
547 o.title = "foo";
548 o.updated = core.DateTime.parse("2002-02-27T14:01:02");
549 }
550 buildCounterActivityFeed--;
551 return o;
552 }
553
554 checkActivityFeed(api.ActivityFeed o) {
555 buildCounterActivityFeed++;
556 if (buildCounterActivityFeed < 3) {
557 unittest.expect(o.etag, unittest.equals('foo'));
558 unittest.expect(o.id, unittest.equals('foo'));
559 checkUnnamed170(o.items);
560 unittest.expect(o.kind, unittest.equals('foo'));
561 unittest.expect(o.nextLink, unittest.equals('foo'));
562 unittest.expect(o.nextPageToken, unittest.equals('foo'));
563 unittest.expect(o.selfLink, unittest.equals('foo'));
564 unittest.expect(o.title, unittest.equals('foo'));
565 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1 4:01:02")));
566 }
567 buildCounterActivityFeed--;
568 }
569
570 core.int buildCounterCommentActorImage = 0;
571 buildCommentActorImage() {
572 var o = new api.CommentActorImage();
573 buildCounterCommentActorImage++;
574 if (buildCounterCommentActorImage < 3) {
575 o.url = "foo";
576 }
577 buildCounterCommentActorImage--;
578 return o;
579 }
580
581 checkCommentActorImage(api.CommentActorImage o) {
582 buildCounterCommentActorImage++;
583 if (buildCounterCommentActorImage < 3) {
584 unittest.expect(o.url, unittest.equals('foo'));
585 }
586 buildCounterCommentActorImage--;
587 }
588
589 core.int buildCounterCommentActor = 0;
590 buildCommentActor() {
591 var o = new api.CommentActor();
592 buildCounterCommentActor++;
593 if (buildCounterCommentActor < 3) {
594 o.displayName = "foo";
595 o.id = "foo";
596 o.image = buildCommentActorImage();
597 o.url = "foo";
598 }
599 buildCounterCommentActor--;
600 return o;
601 }
602
603 checkCommentActor(api.CommentActor o) {
604 buildCounterCommentActor++;
605 if (buildCounterCommentActor < 3) {
606 unittest.expect(o.displayName, unittest.equals('foo'));
607 unittest.expect(o.id, unittest.equals('foo'));
608 checkCommentActorImage(o.image);
609 unittest.expect(o.url, unittest.equals('foo'));
610 }
611 buildCounterCommentActor--;
612 }
613
614 core.int buildCounterCommentInReplyTo = 0;
615 buildCommentInReplyTo() {
616 var o = new api.CommentInReplyTo();
617 buildCounterCommentInReplyTo++;
618 if (buildCounterCommentInReplyTo < 3) {
619 o.id = "foo";
620 o.url = "foo";
621 }
622 buildCounterCommentInReplyTo--;
623 return o;
624 }
625
626 checkCommentInReplyTo(api.CommentInReplyTo o) {
627 buildCounterCommentInReplyTo++;
628 if (buildCounterCommentInReplyTo < 3) {
629 unittest.expect(o.id, unittest.equals('foo'));
630 unittest.expect(o.url, unittest.equals('foo'));
631 }
632 buildCounterCommentInReplyTo--;
633 }
634
635 buildUnnamed171() {
636 var o = new core.List<api.CommentInReplyTo>();
637 o.add(buildCommentInReplyTo());
638 o.add(buildCommentInReplyTo());
639 return o;
640 }
641
642 checkUnnamed171(core.List<api.CommentInReplyTo> o) {
643 unittest.expect(o, unittest.hasLength(2));
644 checkCommentInReplyTo(o[0]);
645 checkCommentInReplyTo(o[1]);
646 }
647
648 core.int buildCounterCommentObject = 0;
649 buildCommentObject() {
650 var o = new api.CommentObject();
651 buildCounterCommentObject++;
652 if (buildCounterCommentObject < 3) {
653 o.content = "foo";
654 o.objectType = "foo";
655 o.originalContent = "foo";
656 }
657 buildCounterCommentObject--;
658 return o;
659 }
660
661 checkCommentObject(api.CommentObject o) {
662 buildCounterCommentObject++;
663 if (buildCounterCommentObject < 3) {
664 unittest.expect(o.content, unittest.equals('foo'));
665 unittest.expect(o.objectType, unittest.equals('foo'));
666 unittest.expect(o.originalContent, unittest.equals('foo'));
667 }
668 buildCounterCommentObject--;
669 }
670
671 core.int buildCounterCommentPlusoners = 0;
672 buildCommentPlusoners() {
673 var o = new api.CommentPlusoners();
674 buildCounterCommentPlusoners++;
675 if (buildCounterCommentPlusoners < 3) {
676 o.totalItems = 42;
677 }
678 buildCounterCommentPlusoners--;
679 return o;
680 }
681
682 checkCommentPlusoners(api.CommentPlusoners o) {
683 buildCounterCommentPlusoners++;
684 if (buildCounterCommentPlusoners < 3) {
685 unittest.expect(o.totalItems, unittest.equals(42));
686 }
687 buildCounterCommentPlusoners--;
688 }
689
690 core.int buildCounterComment = 0;
691 buildComment() {
692 var o = new api.Comment();
693 buildCounterComment++;
694 if (buildCounterComment < 3) {
695 o.actor = buildCommentActor();
696 o.etag = "foo";
697 o.id = "foo";
698 o.inReplyTo = buildUnnamed171();
699 o.kind = "foo";
700 o.object = buildCommentObject();
701 o.plusoners = buildCommentPlusoners();
702 o.published = core.DateTime.parse("2002-02-27T14:01:02");
703 o.selfLink = "foo";
704 o.updated = core.DateTime.parse("2002-02-27T14:01:02");
705 o.verb = "foo";
706 }
707 buildCounterComment--;
708 return o;
709 }
710
711 checkComment(api.Comment o) {
712 buildCounterComment++;
713 if (buildCounterComment < 3) {
714 checkCommentActor(o.actor);
715 unittest.expect(o.etag, unittest.equals('foo'));
716 unittest.expect(o.id, unittest.equals('foo'));
717 checkUnnamed171(o.inReplyTo);
718 unittest.expect(o.kind, unittest.equals('foo'));
719 checkCommentObject(o.object);
720 checkCommentPlusoners(o.plusoners);
721 unittest.expect(o.published, unittest.equals(core.DateTime.parse("2002-02-27 T14:01:02")));
722 unittest.expect(o.selfLink, unittest.equals('foo'));
723 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1 4:01:02")));
724 unittest.expect(o.verb, unittest.equals('foo'));
725 }
726 buildCounterComment--;
727 }
728
729 buildUnnamed172() {
730 var o = new core.List<api.Comment>();
731 o.add(buildComment());
732 o.add(buildComment());
733 return o;
734 }
735
736 checkUnnamed172(core.List<api.Comment> o) {
737 unittest.expect(o, unittest.hasLength(2));
738 checkComment(o[0]);
739 checkComment(o[1]);
740 }
741
742 core.int buildCounterCommentFeed = 0;
743 buildCommentFeed() {
744 var o = new api.CommentFeed();
745 buildCounterCommentFeed++;
746 if (buildCounterCommentFeed < 3) {
747 o.etag = "foo";
748 o.id = "foo";
749 o.items = buildUnnamed172();
750 o.kind = "foo";
751 o.nextLink = "foo";
752 o.nextPageToken = "foo";
753 o.title = "foo";
754 o.updated = core.DateTime.parse("2002-02-27T14:01:02");
755 }
756 buildCounterCommentFeed--;
757 return o;
758 }
759
760 checkCommentFeed(api.CommentFeed o) {
761 buildCounterCommentFeed++;
762 if (buildCounterCommentFeed < 3) {
763 unittest.expect(o.etag, unittest.equals('foo'));
764 unittest.expect(o.id, unittest.equals('foo'));
765 checkUnnamed172(o.items);
766 unittest.expect(o.kind, unittest.equals('foo'));
767 unittest.expect(o.nextLink, unittest.equals('foo'));
768 unittest.expect(o.nextPageToken, unittest.equals('foo'));
769 unittest.expect(o.title, unittest.equals('foo'));
770 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1 4:01:02")));
771 }
772 buildCounterCommentFeed--;
773 }
774
775 buildUnnamed173() {
776 var o = new core.List<core.String>();
777 o.add("foo");
778 o.add("foo");
779 return o;
780 }
781
782 checkUnnamed173(core.List<core.String> o) {
783 unittest.expect(o, unittest.hasLength(2));
784 unittest.expect(o[0], unittest.equals('foo'));
785 unittest.expect(o[1], unittest.equals('foo'));
786 }
787
788 buildUnnamed174() {
789 var o = new core.List<api.ItemScope>();
790 o.add(buildItemScope());
791 o.add(buildItemScope());
792 return o;
793 }
794
795 checkUnnamed174(core.List<api.ItemScope> o) {
796 unittest.expect(o, unittest.hasLength(2));
797 checkItemScope(o[0]);
798 checkItemScope(o[1]);
799 }
800
801 buildUnnamed175() {
802 var o = new core.List<api.ItemScope>();
803 o.add(buildItemScope());
804 o.add(buildItemScope());
805 return o;
806 }
807
808 checkUnnamed175(core.List<api.ItemScope> o) {
809 unittest.expect(o, unittest.hasLength(2));
810 checkItemScope(o[0]);
811 checkItemScope(o[1]);
812 }
813
814 buildUnnamed176() {
815 var o = new core.List<api.ItemScope>();
816 o.add(buildItemScope());
817 o.add(buildItemScope());
818 return o;
819 }
820
821 checkUnnamed176(core.List<api.ItemScope> o) {
822 unittest.expect(o, unittest.hasLength(2));
823 checkItemScope(o[0]);
824 checkItemScope(o[1]);
825 }
826
827 buildUnnamed177() {
828 var o = new core.List<api.ItemScope>();
829 o.add(buildItemScope());
830 o.add(buildItemScope());
831 return o;
832 }
833
834 checkUnnamed177(core.List<api.ItemScope> o) {
835 unittest.expect(o, unittest.hasLength(2));
836 checkItemScope(o[0]);
837 checkItemScope(o[1]);
838 }
839
840 buildUnnamed178() {
841 var o = new core.List<api.ItemScope>();
842 o.add(buildItemScope());
843 o.add(buildItemScope());
844 return o;
845 }
846
847 checkUnnamed178(core.List<api.ItemScope> o) {
848 unittest.expect(o, unittest.hasLength(2));
849 checkItemScope(o[0]);
850 checkItemScope(o[1]);
851 }
852
853 core.int buildCounterItemScope = 0;
854 buildItemScope() {
855 var o = new api.ItemScope();
856 buildCounterItemScope++;
857 if (buildCounterItemScope < 3) {
858 o.about = buildItemScope();
859 o.additionalName = buildUnnamed173();
860 o.address = buildItemScope();
861 o.addressCountry = "foo";
862 o.addressLocality = "foo";
863 o.addressRegion = "foo";
864 o.associatedMedia = buildUnnamed174();
865 o.attendeeCount = 42;
866 o.attendees = buildUnnamed175();
867 o.audio = buildItemScope();
868 o.author = buildUnnamed176();
869 o.bestRating = "foo";
870 o.birthDate = "foo";
871 o.byArtist = buildItemScope();
872 o.caption = "foo";
873 o.contentSize = "foo";
874 o.contentUrl = "foo";
875 o.contributor = buildUnnamed177();
876 o.dateCreated = "foo";
877 o.dateModified = "foo";
878 o.datePublished = "foo";
879 o.description = "foo";
880 o.duration = "foo";
881 o.embedUrl = "foo";
882 o.endDate = "foo";
883 o.familyName = "foo";
884 o.gender = "foo";
885 o.geo = buildItemScope();
886 o.givenName = "foo";
887 o.height = "foo";
888 o.id = "foo";
889 o.image = "foo";
890 o.inAlbum = buildItemScope();
891 o.kind = "foo";
892 o.latitude = 42.0;
893 o.location = buildItemScope();
894 o.longitude = 42.0;
895 o.name = "foo";
896 o.partOfTVSeries = buildItemScope();
897 o.performers = buildUnnamed178();
898 o.playerType = "foo";
899 o.postOfficeBoxNumber = "foo";
900 o.postalCode = "foo";
901 o.ratingValue = "foo";
902 o.reviewRating = buildItemScope();
903 o.startDate = "foo";
904 o.streetAddress = "foo";
905 o.text = "foo";
906 o.thumbnail = buildItemScope();
907 o.thumbnailUrl = "foo";
908 o.tickerSymbol = "foo";
909 o.type = "foo";
910 o.url = "foo";
911 o.width = "foo";
912 o.worstRating = "foo";
913 }
914 buildCounterItemScope--;
915 return o;
916 }
917
918 checkItemScope(api.ItemScope o) {
919 buildCounterItemScope++;
920 if (buildCounterItemScope < 3) {
921 checkItemScope(o.about);
922 checkUnnamed173(o.additionalName);
923 checkItemScope(o.address);
924 unittest.expect(o.addressCountry, unittest.equals('foo'));
925 unittest.expect(o.addressLocality, unittest.equals('foo'));
926 unittest.expect(o.addressRegion, unittest.equals('foo'));
927 checkUnnamed174(o.associatedMedia);
928 unittest.expect(o.attendeeCount, unittest.equals(42));
929 checkUnnamed175(o.attendees);
930 checkItemScope(o.audio);
931 checkUnnamed176(o.author);
932 unittest.expect(o.bestRating, unittest.equals('foo'));
933 unittest.expect(o.birthDate, unittest.equals('foo'));
934 checkItemScope(o.byArtist);
935 unittest.expect(o.caption, unittest.equals('foo'));
936 unittest.expect(o.contentSize, unittest.equals('foo'));
937 unittest.expect(o.contentUrl, unittest.equals('foo'));
938 checkUnnamed177(o.contributor);
939 unittest.expect(o.dateCreated, unittest.equals('foo'));
940 unittest.expect(o.dateModified, unittest.equals('foo'));
941 unittest.expect(o.datePublished, unittest.equals('foo'));
942 unittest.expect(o.description, unittest.equals('foo'));
943 unittest.expect(o.duration, unittest.equals('foo'));
944 unittest.expect(o.embedUrl, unittest.equals('foo'));
945 unittest.expect(o.endDate, unittest.equals('foo'));
946 unittest.expect(o.familyName, unittest.equals('foo'));
947 unittest.expect(o.gender, unittest.equals('foo'));
948 checkItemScope(o.geo);
949 unittest.expect(o.givenName, unittest.equals('foo'));
950 unittest.expect(o.height, unittest.equals('foo'));
951 unittest.expect(o.id, unittest.equals('foo'));
952 unittest.expect(o.image, unittest.equals('foo'));
953 checkItemScope(o.inAlbum);
954 unittest.expect(o.kind, unittest.equals('foo'));
955 unittest.expect(o.latitude, unittest.equals(42.0));
956 checkItemScope(o.location);
957 unittest.expect(o.longitude, unittest.equals(42.0));
958 unittest.expect(o.name, unittest.equals('foo'));
959 checkItemScope(o.partOfTVSeries);
960 checkUnnamed178(o.performers);
961 unittest.expect(o.playerType, unittest.equals('foo'));
962 unittest.expect(o.postOfficeBoxNumber, unittest.equals('foo'));
963 unittest.expect(o.postalCode, unittest.equals('foo'));
964 unittest.expect(o.ratingValue, unittest.equals('foo'));
965 checkItemScope(o.reviewRating);
966 unittest.expect(o.startDate, unittest.equals('foo'));
967 unittest.expect(o.streetAddress, unittest.equals('foo'));
968 unittest.expect(o.text, unittest.equals('foo'));
969 checkItemScope(o.thumbnail);
970 unittest.expect(o.thumbnailUrl, unittest.equals('foo'));
971 unittest.expect(o.tickerSymbol, unittest.equals('foo'));
972 unittest.expect(o.type, unittest.equals('foo'));
973 unittest.expect(o.url, unittest.equals('foo'));
974 unittest.expect(o.width, unittest.equals('foo'));
975 unittest.expect(o.worstRating, unittest.equals('foo'));
976 }
977 buildCounterItemScope--;
978 }
979
980 core.int buildCounterMoment = 0;
981 buildMoment() {
982 var o = new api.Moment();
983 buildCounterMoment++;
984 if (buildCounterMoment < 3) {
985 o.id = "foo";
986 o.kind = "foo";
987 o.object = buildItemScope();
988 o.result = buildItemScope();
989 o.startDate = core.DateTime.parse("2002-02-27T14:01:02");
990 o.target = buildItemScope();
991 o.type = "foo";
992 }
993 buildCounterMoment--;
994 return o;
995 }
996
997 checkMoment(api.Moment o) {
998 buildCounterMoment++;
999 if (buildCounterMoment < 3) {
1000 unittest.expect(o.id, unittest.equals('foo'));
1001 unittest.expect(o.kind, unittest.equals('foo'));
1002 checkItemScope(o.object);
1003 checkItemScope(o.result);
1004 unittest.expect(o.startDate, unittest.equals(core.DateTime.parse("2002-02-27 T14:01:02")));
1005 checkItemScope(o.target);
1006 unittest.expect(o.type, unittest.equals('foo'));
1007 }
1008 buildCounterMoment--;
1009 }
1010
1011 buildUnnamed179() {
1012 var o = new core.List<api.Moment>();
1013 o.add(buildMoment());
1014 o.add(buildMoment());
1015 return o;
1016 }
1017
1018 checkUnnamed179(core.List<api.Moment> o) {
1019 unittest.expect(o, unittest.hasLength(2));
1020 checkMoment(o[0]);
1021 checkMoment(o[1]);
1022 }
1023
1024 core.int buildCounterMomentsFeed = 0;
1025 buildMomentsFeed() {
1026 var o = new api.MomentsFeed();
1027 buildCounterMomentsFeed++;
1028 if (buildCounterMomentsFeed < 3) {
1029 o.etag = "foo";
1030 o.items = buildUnnamed179();
1031 o.kind = "foo";
1032 o.nextLink = "foo";
1033 o.nextPageToken = "foo";
1034 o.selfLink = "foo";
1035 o.title = "foo";
1036 o.updated = core.DateTime.parse("2002-02-27T14:01:02");
1037 }
1038 buildCounterMomentsFeed--;
1039 return o;
1040 }
1041
1042 checkMomentsFeed(api.MomentsFeed o) {
1043 buildCounterMomentsFeed++;
1044 if (buildCounterMomentsFeed < 3) {
1045 unittest.expect(o.etag, unittest.equals('foo'));
1046 checkUnnamed179(o.items);
1047 unittest.expect(o.kind, unittest.equals('foo'));
1048 unittest.expect(o.nextLink, unittest.equals('foo'));
1049 unittest.expect(o.nextPageToken, unittest.equals('foo'));
1050 unittest.expect(o.selfLink, unittest.equals('foo'));
1051 unittest.expect(o.title, unittest.equals('foo'));
1052 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1 4:01:02")));
1053 }
1054 buildCounterMomentsFeed--;
1055 }
1056
1057 buildUnnamed180() {
1058 var o = new core.List<api.Person>();
1059 o.add(buildPerson());
1060 o.add(buildPerson());
1061 return o;
1062 }
1063
1064 checkUnnamed180(core.List<api.Person> o) {
1065 unittest.expect(o, unittest.hasLength(2));
1066 checkPerson(o[0]);
1067 checkPerson(o[1]);
1068 }
1069
1070 core.int buildCounterPeopleFeed = 0;
1071 buildPeopleFeed() {
1072 var o = new api.PeopleFeed();
1073 buildCounterPeopleFeed++;
1074 if (buildCounterPeopleFeed < 3) {
1075 o.etag = "foo";
1076 o.items = buildUnnamed180();
1077 o.kind = "foo";
1078 o.nextPageToken = "foo";
1079 o.selfLink = "foo";
1080 o.title = "foo";
1081 o.totalItems = 42;
1082 }
1083 buildCounterPeopleFeed--;
1084 return o;
1085 }
1086
1087 checkPeopleFeed(api.PeopleFeed o) {
1088 buildCounterPeopleFeed++;
1089 if (buildCounterPeopleFeed < 3) {
1090 unittest.expect(o.etag, unittest.equals('foo'));
1091 checkUnnamed180(o.items);
1092 unittest.expect(o.kind, unittest.equals('foo'));
1093 unittest.expect(o.nextPageToken, unittest.equals('foo'));
1094 unittest.expect(o.selfLink, unittest.equals('foo'));
1095 unittest.expect(o.title, unittest.equals('foo'));
1096 unittest.expect(o.totalItems, unittest.equals(42));
1097 }
1098 buildCounterPeopleFeed--;
1099 }
1100
1101 core.int buildCounterPersonAgeRange = 0;
1102 buildPersonAgeRange() {
1103 var o = new api.PersonAgeRange();
1104 buildCounterPersonAgeRange++;
1105 if (buildCounterPersonAgeRange < 3) {
1106 o.max = 42;
1107 o.min = 42;
1108 }
1109 buildCounterPersonAgeRange--;
1110 return o;
1111 }
1112
1113 checkPersonAgeRange(api.PersonAgeRange o) {
1114 buildCounterPersonAgeRange++;
1115 if (buildCounterPersonAgeRange < 3) {
1116 unittest.expect(o.max, unittest.equals(42));
1117 unittest.expect(o.min, unittest.equals(42));
1118 }
1119 buildCounterPersonAgeRange--;
1120 }
1121
1122 core.int buildCounterPersonCoverCoverInfo = 0;
1123 buildPersonCoverCoverInfo() {
1124 var o = new api.PersonCoverCoverInfo();
1125 buildCounterPersonCoverCoverInfo++;
1126 if (buildCounterPersonCoverCoverInfo < 3) {
1127 o.leftImageOffset = 42;
1128 o.topImageOffset = 42;
1129 }
1130 buildCounterPersonCoverCoverInfo--;
1131 return o;
1132 }
1133
1134 checkPersonCoverCoverInfo(api.PersonCoverCoverInfo o) {
1135 buildCounterPersonCoverCoverInfo++;
1136 if (buildCounterPersonCoverCoverInfo < 3) {
1137 unittest.expect(o.leftImageOffset, unittest.equals(42));
1138 unittest.expect(o.topImageOffset, unittest.equals(42));
1139 }
1140 buildCounterPersonCoverCoverInfo--;
1141 }
1142
1143 core.int buildCounterPersonCoverCoverPhoto = 0;
1144 buildPersonCoverCoverPhoto() {
1145 var o = new api.PersonCoverCoverPhoto();
1146 buildCounterPersonCoverCoverPhoto++;
1147 if (buildCounterPersonCoverCoverPhoto < 3) {
1148 o.height = 42;
1149 o.url = "foo";
1150 o.width = 42;
1151 }
1152 buildCounterPersonCoverCoverPhoto--;
1153 return o;
1154 }
1155
1156 checkPersonCoverCoverPhoto(api.PersonCoverCoverPhoto o) {
1157 buildCounterPersonCoverCoverPhoto++;
1158 if (buildCounterPersonCoverCoverPhoto < 3) {
1159 unittest.expect(o.height, unittest.equals(42));
1160 unittest.expect(o.url, unittest.equals('foo'));
1161 unittest.expect(o.width, unittest.equals(42));
1162 }
1163 buildCounterPersonCoverCoverPhoto--;
1164 }
1165
1166 core.int buildCounterPersonCover = 0;
1167 buildPersonCover() {
1168 var o = new api.PersonCover();
1169 buildCounterPersonCover++;
1170 if (buildCounterPersonCover < 3) {
1171 o.coverInfo = buildPersonCoverCoverInfo();
1172 o.coverPhoto = buildPersonCoverCoverPhoto();
1173 o.layout = "foo";
1174 }
1175 buildCounterPersonCover--;
1176 return o;
1177 }
1178
1179 checkPersonCover(api.PersonCover o) {
1180 buildCounterPersonCover++;
1181 if (buildCounterPersonCover < 3) {
1182 checkPersonCoverCoverInfo(o.coverInfo);
1183 checkPersonCoverCoverPhoto(o.coverPhoto);
1184 unittest.expect(o.layout, unittest.equals('foo'));
1185 }
1186 buildCounterPersonCover--;
1187 }
1188
1189 core.int buildCounterPersonEmails = 0;
1190 buildPersonEmails() {
1191 var o = new api.PersonEmails();
1192 buildCounterPersonEmails++;
1193 if (buildCounterPersonEmails < 3) {
1194 o.type = "foo";
1195 o.value = "foo";
1196 }
1197 buildCounterPersonEmails--;
1198 return o;
1199 }
1200
1201 checkPersonEmails(api.PersonEmails o) {
1202 buildCounterPersonEmails++;
1203 if (buildCounterPersonEmails < 3) {
1204 unittest.expect(o.type, unittest.equals('foo'));
1205 unittest.expect(o.value, unittest.equals('foo'));
1206 }
1207 buildCounterPersonEmails--;
1208 }
1209
1210 buildUnnamed181() {
1211 var o = new core.List<api.PersonEmails>();
1212 o.add(buildPersonEmails());
1213 o.add(buildPersonEmails());
1214 return o;
1215 }
1216
1217 checkUnnamed181(core.List<api.PersonEmails> o) {
1218 unittest.expect(o, unittest.hasLength(2));
1219 checkPersonEmails(o[0]);
1220 checkPersonEmails(o[1]);
1221 }
1222
1223 core.int buildCounterPersonImage = 0;
1224 buildPersonImage() {
1225 var o = new api.PersonImage();
1226 buildCounterPersonImage++;
1227 if (buildCounterPersonImage < 3) {
1228 o.isDefault = true;
1229 o.url = "foo";
1230 }
1231 buildCounterPersonImage--;
1232 return o;
1233 }
1234
1235 checkPersonImage(api.PersonImage o) {
1236 buildCounterPersonImage++;
1237 if (buildCounterPersonImage < 3) {
1238 unittest.expect(o.isDefault, unittest.isTrue);
1239 unittest.expect(o.url, unittest.equals('foo'));
1240 }
1241 buildCounterPersonImage--;
1242 }
1243
1244 core.int buildCounterPersonName = 0;
1245 buildPersonName() {
1246 var o = new api.PersonName();
1247 buildCounterPersonName++;
1248 if (buildCounterPersonName < 3) {
1249 o.familyName = "foo";
1250 o.formatted = "foo";
1251 o.givenName = "foo";
1252 o.honorificPrefix = "foo";
1253 o.honorificSuffix = "foo";
1254 o.middleName = "foo";
1255 }
1256 buildCounterPersonName--;
1257 return o;
1258 }
1259
1260 checkPersonName(api.PersonName o) {
1261 buildCounterPersonName++;
1262 if (buildCounterPersonName < 3) {
1263 unittest.expect(o.familyName, unittest.equals('foo'));
1264 unittest.expect(o.formatted, unittest.equals('foo'));
1265 unittest.expect(o.givenName, unittest.equals('foo'));
1266 unittest.expect(o.honorificPrefix, unittest.equals('foo'));
1267 unittest.expect(o.honorificSuffix, unittest.equals('foo'));
1268 unittest.expect(o.middleName, unittest.equals('foo'));
1269 }
1270 buildCounterPersonName--;
1271 }
1272
1273 core.int buildCounterPersonOrganizations = 0;
1274 buildPersonOrganizations() {
1275 var o = new api.PersonOrganizations();
1276 buildCounterPersonOrganizations++;
1277 if (buildCounterPersonOrganizations < 3) {
1278 o.department = "foo";
1279 o.description = "foo";
1280 o.endDate = "foo";
1281 o.location = "foo";
1282 o.name = "foo";
1283 o.primary = true;
1284 o.startDate = "foo";
1285 o.title = "foo";
1286 o.type = "foo";
1287 }
1288 buildCounterPersonOrganizations--;
1289 return o;
1290 }
1291
1292 checkPersonOrganizations(api.PersonOrganizations o) {
1293 buildCounterPersonOrganizations++;
1294 if (buildCounterPersonOrganizations < 3) {
1295 unittest.expect(o.department, unittest.equals('foo'));
1296 unittest.expect(o.description, unittest.equals('foo'));
1297 unittest.expect(o.endDate, unittest.equals('foo'));
1298 unittest.expect(o.location, unittest.equals('foo'));
1299 unittest.expect(o.name, unittest.equals('foo'));
1300 unittest.expect(o.primary, unittest.isTrue);
1301 unittest.expect(o.startDate, unittest.equals('foo'));
1302 unittest.expect(o.title, unittest.equals('foo'));
1303 unittest.expect(o.type, unittest.equals('foo'));
1304 }
1305 buildCounterPersonOrganizations--;
1306 }
1307
1308 buildUnnamed182() {
1309 var o = new core.List<api.PersonOrganizations>();
1310 o.add(buildPersonOrganizations());
1311 o.add(buildPersonOrganizations());
1312 return o;
1313 }
1314
1315 checkUnnamed182(core.List<api.PersonOrganizations> o) {
1316 unittest.expect(o, unittest.hasLength(2));
1317 checkPersonOrganizations(o[0]);
1318 checkPersonOrganizations(o[1]);
1319 }
1320
1321 core.int buildCounterPersonPlacesLived = 0;
1322 buildPersonPlacesLived() {
1323 var o = new api.PersonPlacesLived();
1324 buildCounterPersonPlacesLived++;
1325 if (buildCounterPersonPlacesLived < 3) {
1326 o.primary = true;
1327 o.value = "foo";
1328 }
1329 buildCounterPersonPlacesLived--;
1330 return o;
1331 }
1332
1333 checkPersonPlacesLived(api.PersonPlacesLived o) {
1334 buildCounterPersonPlacesLived++;
1335 if (buildCounterPersonPlacesLived < 3) {
1336 unittest.expect(o.primary, unittest.isTrue);
1337 unittest.expect(o.value, unittest.equals('foo'));
1338 }
1339 buildCounterPersonPlacesLived--;
1340 }
1341
1342 buildUnnamed183() {
1343 var o = new core.List<api.PersonPlacesLived>();
1344 o.add(buildPersonPlacesLived());
1345 o.add(buildPersonPlacesLived());
1346 return o;
1347 }
1348
1349 checkUnnamed183(core.List<api.PersonPlacesLived> o) {
1350 unittest.expect(o, unittest.hasLength(2));
1351 checkPersonPlacesLived(o[0]);
1352 checkPersonPlacesLived(o[1]);
1353 }
1354
1355 core.int buildCounterPersonUrls = 0;
1356 buildPersonUrls() {
1357 var o = new api.PersonUrls();
1358 buildCounterPersonUrls++;
1359 if (buildCounterPersonUrls < 3) {
1360 o.label = "foo";
1361 o.type = "foo";
1362 o.value = "foo";
1363 }
1364 buildCounterPersonUrls--;
1365 return o;
1366 }
1367
1368 checkPersonUrls(api.PersonUrls o) {
1369 buildCounterPersonUrls++;
1370 if (buildCounterPersonUrls < 3) {
1371 unittest.expect(o.label, unittest.equals('foo'));
1372 unittest.expect(o.type, unittest.equals('foo'));
1373 unittest.expect(o.value, unittest.equals('foo'));
1374 }
1375 buildCounterPersonUrls--;
1376 }
1377
1378 buildUnnamed184() {
1379 var o = new core.List<api.PersonUrls>();
1380 o.add(buildPersonUrls());
1381 o.add(buildPersonUrls());
1382 return o;
1383 }
1384
1385 checkUnnamed184(core.List<api.PersonUrls> o) {
1386 unittest.expect(o, unittest.hasLength(2));
1387 checkPersonUrls(o[0]);
1388 checkPersonUrls(o[1]);
1389 }
1390
1391 core.int buildCounterPerson = 0;
1392 buildPerson() {
1393 var o = new api.Person();
1394 buildCounterPerson++;
1395 if (buildCounterPerson < 3) {
1396 o.aboutMe = "foo";
1397 o.ageRange = buildPersonAgeRange();
1398 o.birthday = "foo";
1399 o.braggingRights = "foo";
1400 o.circledByCount = 42;
1401 o.cover = buildPersonCover();
1402 o.currentLocation = "foo";
1403 o.displayName = "foo";
1404 o.domain = "foo";
1405 o.emails = buildUnnamed181();
1406 o.etag = "foo";
1407 o.gender = "foo";
1408 o.id = "foo";
1409 o.image = buildPersonImage();
1410 o.isPlusUser = true;
1411 o.kind = "foo";
1412 o.language = "foo";
1413 o.name = buildPersonName();
1414 o.nickname = "foo";
1415 o.objectType = "foo";
1416 o.occupation = "foo";
1417 o.organizations = buildUnnamed182();
1418 o.placesLived = buildUnnamed183();
1419 o.plusOneCount = 42;
1420 o.relationshipStatus = "foo";
1421 o.skills = "foo";
1422 o.tagline = "foo";
1423 o.url = "foo";
1424 o.urls = buildUnnamed184();
1425 o.verified = true;
1426 }
1427 buildCounterPerson--;
1428 return o;
1429 }
1430
1431 checkPerson(api.Person o) {
1432 buildCounterPerson++;
1433 if (buildCounterPerson < 3) {
1434 unittest.expect(o.aboutMe, unittest.equals('foo'));
1435 checkPersonAgeRange(o.ageRange);
1436 unittest.expect(o.birthday, unittest.equals('foo'));
1437 unittest.expect(o.braggingRights, unittest.equals('foo'));
1438 unittest.expect(o.circledByCount, unittest.equals(42));
1439 checkPersonCover(o.cover);
1440 unittest.expect(o.currentLocation, unittest.equals('foo'));
1441 unittest.expect(o.displayName, unittest.equals('foo'));
1442 unittest.expect(o.domain, unittest.equals('foo'));
1443 checkUnnamed181(o.emails);
1444 unittest.expect(o.etag, unittest.equals('foo'));
1445 unittest.expect(o.gender, unittest.equals('foo'));
1446 unittest.expect(o.id, unittest.equals('foo'));
1447 checkPersonImage(o.image);
1448 unittest.expect(o.isPlusUser, unittest.isTrue);
1449 unittest.expect(o.kind, unittest.equals('foo'));
1450 unittest.expect(o.language, unittest.equals('foo'));
1451 checkPersonName(o.name);
1452 unittest.expect(o.nickname, unittest.equals('foo'));
1453 unittest.expect(o.objectType, unittest.equals('foo'));
1454 unittest.expect(o.occupation, unittest.equals('foo'));
1455 checkUnnamed182(o.organizations);
1456 checkUnnamed183(o.placesLived);
1457 unittest.expect(o.plusOneCount, unittest.equals(42));
1458 unittest.expect(o.relationshipStatus, unittest.equals('foo'));
1459 unittest.expect(o.skills, unittest.equals('foo'));
1460 unittest.expect(o.tagline, unittest.equals('foo'));
1461 unittest.expect(o.url, unittest.equals('foo'));
1462 checkUnnamed184(o.urls);
1463 unittest.expect(o.verified, unittest.isTrue);
1464 }
1465 buildCounterPerson--;
1466 }
1467
1468 core.int buildCounterPlaceAddress = 0;
1469 buildPlaceAddress() {
1470 var o = new api.PlaceAddress();
1471 buildCounterPlaceAddress++;
1472 if (buildCounterPlaceAddress < 3) {
1473 o.formatted = "foo";
1474 }
1475 buildCounterPlaceAddress--;
1476 return o;
1477 }
1478
1479 checkPlaceAddress(api.PlaceAddress o) {
1480 buildCounterPlaceAddress++;
1481 if (buildCounterPlaceAddress < 3) {
1482 unittest.expect(o.formatted, unittest.equals('foo'));
1483 }
1484 buildCounterPlaceAddress--;
1485 }
1486
1487 core.int buildCounterPlacePosition = 0;
1488 buildPlacePosition() {
1489 var o = new api.PlacePosition();
1490 buildCounterPlacePosition++;
1491 if (buildCounterPlacePosition < 3) {
1492 o.latitude = 42.0;
1493 o.longitude = 42.0;
1494 }
1495 buildCounterPlacePosition--;
1496 return o;
1497 }
1498
1499 checkPlacePosition(api.PlacePosition o) {
1500 buildCounterPlacePosition++;
1501 if (buildCounterPlacePosition < 3) {
1502 unittest.expect(o.latitude, unittest.equals(42.0));
1503 unittest.expect(o.longitude, unittest.equals(42.0));
1504 }
1505 buildCounterPlacePosition--;
1506 }
1507
1508 core.int buildCounterPlace = 0;
1509 buildPlace() {
1510 var o = new api.Place();
1511 buildCounterPlace++;
1512 if (buildCounterPlace < 3) {
1513 o.address = buildPlaceAddress();
1514 o.displayName = "foo";
1515 o.id = "foo";
1516 o.kind = "foo";
1517 o.position = buildPlacePosition();
1518 }
1519 buildCounterPlace--;
1520 return o;
1521 }
1522
1523 checkPlace(api.Place o) {
1524 buildCounterPlace++;
1525 if (buildCounterPlace < 3) {
1526 checkPlaceAddress(o.address);
1527 unittest.expect(o.displayName, unittest.equals('foo'));
1528 unittest.expect(o.id, unittest.equals('foo'));
1529 unittest.expect(o.kind, unittest.equals('foo'));
1530 checkPlacePosition(o.position);
1531 }
1532 buildCounterPlace--;
1533 }
1534
1535 core.int buildCounterPlusAclentryResource = 0;
1536 buildPlusAclentryResource() {
1537 var o = new api.PlusAclentryResource();
1538 buildCounterPlusAclentryResource++;
1539 if (buildCounterPlusAclentryResource < 3) {
1540 o.displayName = "foo";
1541 o.id = "foo";
1542 o.type = "foo";
1543 }
1544 buildCounterPlusAclentryResource--;
1545 return o;
1546 }
1547
1548 checkPlusAclentryResource(api.PlusAclentryResource o) {
1549 buildCounterPlusAclentryResource++;
1550 if (buildCounterPlusAclentryResource < 3) {
1551 unittest.expect(o.displayName, unittest.equals('foo'));
1552 unittest.expect(o.id, unittest.equals('foo'));
1553 unittest.expect(o.type, unittest.equals('foo'));
1554 }
1555 buildCounterPlusAclentryResource--;
1556 }
1557
1558
1559 main() {
1560 unittest.group("obj-schema-Acl", () {
1561 unittest.test("to-json--from-json", () {
1562 var o = buildAcl();
1563 var od = new api.Acl.fromJson(o.toJson());
1564 checkAcl(od);
1565 });
1566 });
1567
1568
1569 unittest.group("obj-schema-ActivityActorImage", () {
1570 unittest.test("to-json--from-json", () {
1571 var o = buildActivityActorImage();
1572 var od = new api.ActivityActorImage.fromJson(o.toJson());
1573 checkActivityActorImage(od);
1574 });
1575 });
1576
1577
1578 unittest.group("obj-schema-ActivityActorName", () {
1579 unittest.test("to-json--from-json", () {
1580 var o = buildActivityActorName();
1581 var od = new api.ActivityActorName.fromJson(o.toJson());
1582 checkActivityActorName(od);
1583 });
1584 });
1585
1586
1587 unittest.group("obj-schema-ActivityActor", () {
1588 unittest.test("to-json--from-json", () {
1589 var o = buildActivityActor();
1590 var od = new api.ActivityActor.fromJson(o.toJson());
1591 checkActivityActor(od);
1592 });
1593 });
1594
1595
1596 unittest.group("obj-schema-ActivityObjectActorImage", () {
1597 unittest.test("to-json--from-json", () {
1598 var o = buildActivityObjectActorImage();
1599 var od = new api.ActivityObjectActorImage.fromJson(o.toJson());
1600 checkActivityObjectActorImage(od);
1601 });
1602 });
1603
1604
1605 unittest.group("obj-schema-ActivityObjectActor", () {
1606 unittest.test("to-json--from-json", () {
1607 var o = buildActivityObjectActor();
1608 var od = new api.ActivityObjectActor.fromJson(o.toJson());
1609 checkActivityObjectActor(od);
1610 });
1611 });
1612
1613
1614 unittest.group("obj-schema-ActivityObjectAttachmentsEmbed", () {
1615 unittest.test("to-json--from-json", () {
1616 var o = buildActivityObjectAttachmentsEmbed();
1617 var od = new api.ActivityObjectAttachmentsEmbed.fromJson(o.toJson());
1618 checkActivityObjectAttachmentsEmbed(od);
1619 });
1620 });
1621
1622
1623 unittest.group("obj-schema-ActivityObjectAttachmentsFullImage", () {
1624 unittest.test("to-json--from-json", () {
1625 var o = buildActivityObjectAttachmentsFullImage();
1626 var od = new api.ActivityObjectAttachmentsFullImage.fromJson(o.toJson());
1627 checkActivityObjectAttachmentsFullImage(od);
1628 });
1629 });
1630
1631
1632 unittest.group("obj-schema-ActivityObjectAttachmentsImage", () {
1633 unittest.test("to-json--from-json", () {
1634 var o = buildActivityObjectAttachmentsImage();
1635 var od = new api.ActivityObjectAttachmentsImage.fromJson(o.toJson());
1636 checkActivityObjectAttachmentsImage(od);
1637 });
1638 });
1639
1640
1641 unittest.group("obj-schema-ActivityObjectAttachmentsThumbnailsImage", () {
1642 unittest.test("to-json--from-json", () {
1643 var o = buildActivityObjectAttachmentsThumbnailsImage();
1644 var od = new api.ActivityObjectAttachmentsThumbnailsImage.fromJson(o.toJso n());
1645 checkActivityObjectAttachmentsThumbnailsImage(od);
1646 });
1647 });
1648
1649
1650 unittest.group("obj-schema-ActivityObjectAttachmentsThumbnails", () {
1651 unittest.test("to-json--from-json", () {
1652 var o = buildActivityObjectAttachmentsThumbnails();
1653 var od = new api.ActivityObjectAttachmentsThumbnails.fromJson(o.toJson());
1654 checkActivityObjectAttachmentsThumbnails(od);
1655 });
1656 });
1657
1658
1659 unittest.group("obj-schema-ActivityObjectAttachments", () {
1660 unittest.test("to-json--from-json", () {
1661 var o = buildActivityObjectAttachments();
1662 var od = new api.ActivityObjectAttachments.fromJson(o.toJson());
1663 checkActivityObjectAttachments(od);
1664 });
1665 });
1666
1667
1668 unittest.group("obj-schema-ActivityObjectPlusoners", () {
1669 unittest.test("to-json--from-json", () {
1670 var o = buildActivityObjectPlusoners();
1671 var od = new api.ActivityObjectPlusoners.fromJson(o.toJson());
1672 checkActivityObjectPlusoners(od);
1673 });
1674 });
1675
1676
1677 unittest.group("obj-schema-ActivityObjectReplies", () {
1678 unittest.test("to-json--from-json", () {
1679 var o = buildActivityObjectReplies();
1680 var od = new api.ActivityObjectReplies.fromJson(o.toJson());
1681 checkActivityObjectReplies(od);
1682 });
1683 });
1684
1685
1686 unittest.group("obj-schema-ActivityObjectResharers", () {
1687 unittest.test("to-json--from-json", () {
1688 var o = buildActivityObjectResharers();
1689 var od = new api.ActivityObjectResharers.fromJson(o.toJson());
1690 checkActivityObjectResharers(od);
1691 });
1692 });
1693
1694
1695 unittest.group("obj-schema-ActivityObject", () {
1696 unittest.test("to-json--from-json", () {
1697 var o = buildActivityObject();
1698 var od = new api.ActivityObject.fromJson(o.toJson());
1699 checkActivityObject(od);
1700 });
1701 });
1702
1703
1704 unittest.group("obj-schema-ActivityProvider", () {
1705 unittest.test("to-json--from-json", () {
1706 var o = buildActivityProvider();
1707 var od = new api.ActivityProvider.fromJson(o.toJson());
1708 checkActivityProvider(od);
1709 });
1710 });
1711
1712
1713 unittest.group("obj-schema-Activity", () {
1714 unittest.test("to-json--from-json", () {
1715 var o = buildActivity();
1716 var od = new api.Activity.fromJson(o.toJson());
1717 checkActivity(od);
1718 });
1719 });
1720
1721
1722 unittest.group("obj-schema-ActivityFeed", () {
1723 unittest.test("to-json--from-json", () {
1724 var o = buildActivityFeed();
1725 var od = new api.ActivityFeed.fromJson(o.toJson());
1726 checkActivityFeed(od);
1727 });
1728 });
1729
1730
1731 unittest.group("obj-schema-CommentActorImage", () {
1732 unittest.test("to-json--from-json", () {
1733 var o = buildCommentActorImage();
1734 var od = new api.CommentActorImage.fromJson(o.toJson());
1735 checkCommentActorImage(od);
1736 });
1737 });
1738
1739
1740 unittest.group("obj-schema-CommentActor", () {
1741 unittest.test("to-json--from-json", () {
1742 var o = buildCommentActor();
1743 var od = new api.CommentActor.fromJson(o.toJson());
1744 checkCommentActor(od);
1745 });
1746 });
1747
1748
1749 unittest.group("obj-schema-CommentInReplyTo", () {
1750 unittest.test("to-json--from-json", () {
1751 var o = buildCommentInReplyTo();
1752 var od = new api.CommentInReplyTo.fromJson(o.toJson());
1753 checkCommentInReplyTo(od);
1754 });
1755 });
1756
1757
1758 unittest.group("obj-schema-CommentObject", () {
1759 unittest.test("to-json--from-json", () {
1760 var o = buildCommentObject();
1761 var od = new api.CommentObject.fromJson(o.toJson());
1762 checkCommentObject(od);
1763 });
1764 });
1765
1766
1767 unittest.group("obj-schema-CommentPlusoners", () {
1768 unittest.test("to-json--from-json", () {
1769 var o = buildCommentPlusoners();
1770 var od = new api.CommentPlusoners.fromJson(o.toJson());
1771 checkCommentPlusoners(od);
1772 });
1773 });
1774
1775
1776 unittest.group("obj-schema-Comment", () {
1777 unittest.test("to-json--from-json", () {
1778 var o = buildComment();
1779 var od = new api.Comment.fromJson(o.toJson());
1780 checkComment(od);
1781 });
1782 });
1783
1784
1785 unittest.group("obj-schema-CommentFeed", () {
1786 unittest.test("to-json--from-json", () {
1787 var o = buildCommentFeed();
1788 var od = new api.CommentFeed.fromJson(o.toJson());
1789 checkCommentFeed(od);
1790 });
1791 });
1792
1793
1794 unittest.group("obj-schema-ItemScope", () {
1795 unittest.test("to-json--from-json", () {
1796 var o = buildItemScope();
1797 var od = new api.ItemScope.fromJson(o.toJson());
1798 checkItemScope(od);
1799 });
1800 });
1801
1802
1803 unittest.group("obj-schema-Moment", () {
1804 unittest.test("to-json--from-json", () {
1805 var o = buildMoment();
1806 var od = new api.Moment.fromJson(o.toJson());
1807 checkMoment(od);
1808 });
1809 });
1810
1811
1812 unittest.group("obj-schema-MomentsFeed", () {
1813 unittest.test("to-json--from-json", () {
1814 var o = buildMomentsFeed();
1815 var od = new api.MomentsFeed.fromJson(o.toJson());
1816 checkMomentsFeed(od);
1817 });
1818 });
1819
1820
1821 unittest.group("obj-schema-PeopleFeed", () {
1822 unittest.test("to-json--from-json", () {
1823 var o = buildPeopleFeed();
1824 var od = new api.PeopleFeed.fromJson(o.toJson());
1825 checkPeopleFeed(od);
1826 });
1827 });
1828
1829
1830 unittest.group("obj-schema-PersonAgeRange", () {
1831 unittest.test("to-json--from-json", () {
1832 var o = buildPersonAgeRange();
1833 var od = new api.PersonAgeRange.fromJson(o.toJson());
1834 checkPersonAgeRange(od);
1835 });
1836 });
1837
1838
1839 unittest.group("obj-schema-PersonCoverCoverInfo", () {
1840 unittest.test("to-json--from-json", () {
1841 var o = buildPersonCoverCoverInfo();
1842 var od = new api.PersonCoverCoverInfo.fromJson(o.toJson());
1843 checkPersonCoverCoverInfo(od);
1844 });
1845 });
1846
1847
1848 unittest.group("obj-schema-PersonCoverCoverPhoto", () {
1849 unittest.test("to-json--from-json", () {
1850 var o = buildPersonCoverCoverPhoto();
1851 var od = new api.PersonCoverCoverPhoto.fromJson(o.toJson());
1852 checkPersonCoverCoverPhoto(od);
1853 });
1854 });
1855
1856
1857 unittest.group("obj-schema-PersonCover", () {
1858 unittest.test("to-json--from-json", () {
1859 var o = buildPersonCover();
1860 var od = new api.PersonCover.fromJson(o.toJson());
1861 checkPersonCover(od);
1862 });
1863 });
1864
1865
1866 unittest.group("obj-schema-PersonEmails", () {
1867 unittest.test("to-json--from-json", () {
1868 var o = buildPersonEmails();
1869 var od = new api.PersonEmails.fromJson(o.toJson());
1870 checkPersonEmails(od);
1871 });
1872 });
1873
1874
1875 unittest.group("obj-schema-PersonImage", () {
1876 unittest.test("to-json--from-json", () {
1877 var o = buildPersonImage();
1878 var od = new api.PersonImage.fromJson(o.toJson());
1879 checkPersonImage(od);
1880 });
1881 });
1882
1883
1884 unittest.group("obj-schema-PersonName", () {
1885 unittest.test("to-json--from-json", () {
1886 var o = buildPersonName();
1887 var od = new api.PersonName.fromJson(o.toJson());
1888 checkPersonName(od);
1889 });
1890 });
1891
1892
1893 unittest.group("obj-schema-PersonOrganizations", () {
1894 unittest.test("to-json--from-json", () {
1895 var o = buildPersonOrganizations();
1896 var od = new api.PersonOrganizations.fromJson(o.toJson());
1897 checkPersonOrganizations(od);
1898 });
1899 });
1900
1901
1902 unittest.group("obj-schema-PersonPlacesLived", () {
1903 unittest.test("to-json--from-json", () {
1904 var o = buildPersonPlacesLived();
1905 var od = new api.PersonPlacesLived.fromJson(o.toJson());
1906 checkPersonPlacesLived(od);
1907 });
1908 });
1909
1910
1911 unittest.group("obj-schema-PersonUrls", () {
1912 unittest.test("to-json--from-json", () {
1913 var o = buildPersonUrls();
1914 var od = new api.PersonUrls.fromJson(o.toJson());
1915 checkPersonUrls(od);
1916 });
1917 });
1918
1919
1920 unittest.group("obj-schema-Person", () {
1921 unittest.test("to-json--from-json", () {
1922 var o = buildPerson();
1923 var od = new api.Person.fromJson(o.toJson());
1924 checkPerson(od);
1925 });
1926 });
1927
1928
1929 unittest.group("obj-schema-PlaceAddress", () {
1930 unittest.test("to-json--from-json", () {
1931 var o = buildPlaceAddress();
1932 var od = new api.PlaceAddress.fromJson(o.toJson());
1933 checkPlaceAddress(od);
1934 });
1935 });
1936
1937
1938 unittest.group("obj-schema-PlacePosition", () {
1939 unittest.test("to-json--from-json", () {
1940 var o = buildPlacePosition();
1941 var od = new api.PlacePosition.fromJson(o.toJson());
1942 checkPlacePosition(od);
1943 });
1944 });
1945
1946
1947 unittest.group("obj-schema-Place", () {
1948 unittest.test("to-json--from-json", () {
1949 var o = buildPlace();
1950 var od = new api.Place.fromJson(o.toJson());
1951 checkPlace(od);
1952 });
1953 });
1954
1955
1956 unittest.group("obj-schema-PlusAclentryResource", () {
1957 unittest.test("to-json--from-json", () {
1958 var o = buildPlusAclentryResource();
1959 var od = new api.PlusAclentryResource.fromJson(o.toJson());
1960 checkPlusAclentryResource(od);
1961 });
1962 });
1963
1964
1965 unittest.group("resource-ActivitiesResourceApi", () {
1966 unittest.test("method--get", () {
1967
1968 var mock = new common_test.HttpServerMock();
1969 api.ActivitiesResourceApi res = new api.PlusApi(mock).activities;
1970 var arg_activityId = "foo";
1971 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1972 var path = (req.url).path;
1973 var pathOffset = 0;
1974 var index;
1975 var subPart;
1976 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als("/plus/v1/"));
1977 pathOffset += 9;
1978 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq uals("activities/"));
1979 pathOffset += 11;
1980 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
1981 pathOffset = path.length;
1982 unittest.expect(subPart, unittest.equals("$arg_activityId"));
1983
1984 var query = (req.url).query;
1985 var queryOffset = 0;
1986 var queryMap = {};
1987 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1988 parseBool(n) {
1989 if (n == "true") return true;
1990 if (n == "false") return false;
1991 if (n == null) return null;
1992 throw new core.ArgumentError("Invalid boolean: $n");
1993 }
1994 if (query.length > 0) {
1995 for (var part in query.split("&")) {
1996 var keyvalue = part.split("=");
1997 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1998 }
1999 }
2000
2001
2002 var h = {
2003 "content-type" : "application/json; charset=utf-8",
2004 };
2005 var resp = convert.JSON.encode(buildActivity());
2006 return new async.Future.value(common_test.stringResponse(200, h, resp));
2007 }), true);
2008 res.get(arg_activityId).then(unittest.expectAsync(((api.Activity response) {
2009 checkActivity(response);
2010 })));
2011 });
2012
2013 unittest.test("method--list", () {
2014
2015 var mock = new common_test.HttpServerMock();
2016 api.ActivitiesResourceApi res = new api.PlusApi(mock).activities;
2017 var arg_userId = "foo";
2018 var arg_collection = "foo";
2019 var arg_maxResults = 42;
2020 var arg_pageToken = "foo";
2021 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
2022 var path = (req.url).path;
2023 var pathOffset = 0;
2024 var index;
2025 var subPart;
2026 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als("/plus/v1/"));
2027 pathOffset += 9;
2028 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ als("people/"));
2029 pathOffset += 7;
2030 index = path.indexOf("/activities/", pathOffset);
2031 unittest.expect(index >= 0, unittest.isTrue);
2032 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index ));
2033 pathOffset = index;
2034 unittest.expect(subPart, unittest.equals("$arg_userId"));
2035 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq uals("/activities/"));
2036 pathOffset += 12;
2037 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
2038 pathOffset = path.length;
2039 unittest.expect(subPart, unittest.equals("$arg_collection"));
2040
2041 var query = (req.url).query;
2042 var queryOffset = 0;
2043 var queryMap = {};
2044 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
2045 parseBool(n) {
2046 if (n == "true") return true;
2047 if (n == "false") return false;
2048 if (n == null) return null;
2049 throw new core.ArgumentError("Invalid boolean: $n");
2050 }
2051 if (query.length > 0) {
2052 for (var part in query.split("&")) {
2053 var keyvalue = part.split("=");
2054 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
2055 }
2056 }
2057 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e quals(arg_maxResults));
2058 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
2059
2060
2061 var h = {
2062 "content-type" : "application/json; charset=utf-8",
2063 };
2064 var resp = convert.JSON.encode(buildActivityFeed());
2065 return new async.Future.value(common_test.stringResponse(200, h, resp));
2066 }), true);
2067 res.list(arg_userId, arg_collection, maxResults: arg_maxResults, pageToken : arg_pageToken).then(unittest.expectAsync(((api.ActivityFeed response) {
2068 checkActivityFeed(response);
2069 })));
2070 });
2071
2072 unittest.test("method--search", () {
2073
2074 var mock = new common_test.HttpServerMock();
2075 api.ActivitiesResourceApi res = new api.PlusApi(mock).activities;
2076 var arg_query = "foo";
2077 var arg_language = "foo";
2078 var arg_maxResults = 42;
2079 var arg_orderBy = "foo";
2080 var arg_pageToken = "foo";
2081 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
2082 var path = (req.url).path;
2083 var pathOffset = 0;
2084 var index;
2085 var subPart;
2086 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als("/plus/v1/"));
2087 pathOffset += 9;
2088 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq uals("activities"));
2089 pathOffset += 10;
2090
2091 var query = (req.url).query;
2092 var queryOffset = 0;
2093 var queryMap = {};
2094 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
2095 parseBool(n) {
2096 if (n == "true") return true;
2097 if (n == "false") return false;
2098 if (n == null) return null;
2099 throw new core.ArgumentError("Invalid boolean: $n");
2100 }
2101 if (query.length > 0) {
2102 for (var part in query.split("&")) {
2103 var keyvalue = part.split("=");
2104 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
2105 }
2106 }
2107 unittest.expect(queryMap["query"].first, unittest.equals(arg_query));
2108 unittest.expect(queryMap["language"].first, unittest.equals(arg_language ));
2109 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e quals(arg_maxResults));
2110 unittest.expect(queryMap["orderBy"].first, unittest.equals(arg_orderBy)) ;
2111 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
2112
2113
2114 var h = {
2115 "content-type" : "application/json; charset=utf-8",
2116 };
2117 var resp = convert.JSON.encode(buildActivityFeed());
2118 return new async.Future.value(common_test.stringResponse(200, h, resp));
2119 }), true);
2120 res.search(arg_query, language: arg_language, maxResults: arg_maxResults, orderBy: arg_orderBy, pageToken: arg_pageToken).then(unittest.expectAsync(((api. ActivityFeed response) {
2121 checkActivityFeed(response);
2122 })));
2123 });
2124
2125 });
2126
2127
2128 unittest.group("resource-CommentsResourceApi", () {
2129 unittest.test("method--get", () {
2130
2131 var mock = new common_test.HttpServerMock();
2132 api.CommentsResourceApi res = new api.PlusApi(mock).comments;
2133 var arg_commentId = "foo";
2134 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
2135 var path = (req.url).path;
2136 var pathOffset = 0;
2137 var index;
2138 var subPart;
2139 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als("/plus/v1/"));
2140 pathOffset += 9;
2141 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als("comments/"));
2142 pathOffset += 9;
2143 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
2144 pathOffset = path.length;
2145 unittest.expect(subPart, unittest.equals("$arg_commentId"));
2146
2147 var query = (req.url).query;
2148 var queryOffset = 0;
2149 var queryMap = {};
2150 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
2151 parseBool(n) {
2152 if (n == "true") return true;
2153 if (n == "false") return false;
2154 if (n == null) return null;
2155 throw new core.ArgumentError("Invalid boolean: $n");
2156 }
2157 if (query.length > 0) {
2158 for (var part in query.split("&")) {
2159 var keyvalue = part.split("=");
2160 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
2161 }
2162 }
2163
2164
2165 var h = {
2166 "content-type" : "application/json; charset=utf-8",
2167 };
2168 var resp = convert.JSON.encode(buildComment());
2169 return new async.Future.value(common_test.stringResponse(200, h, resp));
2170 }), true);
2171 res.get(arg_commentId).then(unittest.expectAsync(((api.Comment response) {
2172 checkComment(response);
2173 })));
2174 });
2175
2176 unittest.test("method--list", () {
2177
2178 var mock = new common_test.HttpServerMock();
2179 api.CommentsResourceApi res = new api.PlusApi(mock).comments;
2180 var arg_activityId = "foo";
2181 var arg_maxResults = 42;
2182 var arg_pageToken = "foo";
2183 var arg_sortOrder = "foo";
2184 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
2185 var path = (req.url).path;
2186 var pathOffset = 0;
2187 var index;
2188 var subPart;
2189 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als("/plus/v1/"));
2190 pathOffset += 9;
2191 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq uals("activities/"));
2192 pathOffset += 11;
2193 index = path.indexOf("/comments", pathOffset);
2194 unittest.expect(index >= 0, unittest.isTrue);
2195 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index ));
2196 pathOffset = index;
2197 unittest.expect(subPart, unittest.equals("$arg_activityId"));
2198 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als("/comments"));
2199 pathOffset += 9;
2200
2201 var query = (req.url).query;
2202 var queryOffset = 0;
2203 var queryMap = {};
2204 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
2205 parseBool(n) {
2206 if (n == "true") return true;
2207 if (n == "false") return false;
2208 if (n == null) return null;
2209 throw new core.ArgumentError("Invalid boolean: $n");
2210 }
2211 if (query.length > 0) {
2212 for (var part in query.split("&")) {
2213 var keyvalue = part.split("=");
2214 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
2215 }
2216 }
2217 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e quals(arg_maxResults));
2218 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
2219 unittest.expect(queryMap["sortOrder"].first, unittest.equals(arg_sortOrd er));
2220
2221
2222 var h = {
2223 "content-type" : "application/json; charset=utf-8",
2224 };
2225 var resp = convert.JSON.encode(buildCommentFeed());
2226 return new async.Future.value(common_test.stringResponse(200, h, resp));
2227 }), true);
2228 res.list(arg_activityId, maxResults: arg_maxResults, pageToken: arg_pageTo ken, sortOrder: arg_sortOrder).then(unittest.expectAsync(((api.CommentFeed respo nse) {
2229 checkCommentFeed(response);
2230 })));
2231 });
2232
2233 });
2234
2235
2236 unittest.group("resource-MomentsResourceApi", () {
2237 unittest.test("method--insert", () {
2238
2239 var mock = new common_test.HttpServerMock();
2240 api.MomentsResourceApi res = new api.PlusApi(mock).moments;
2241 var arg_request = buildMoment();
2242 var arg_userId = "foo";
2243 var arg_collection = "foo";
2244 var arg_debug = true;
2245 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
2246 var obj = new api.Moment.fromJson(json);
2247 checkMoment(obj);
2248
2249 var path = (req.url).path;
2250 var pathOffset = 0;
2251 var index;
2252 var subPart;
2253 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als("/plus/v1/"));
2254 pathOffset += 9;
2255 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ als("people/"));
2256 pathOffset += 7;
2257 index = path.indexOf("/moments/", pathOffset);
2258 unittest.expect(index >= 0, unittest.isTrue);
2259 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index ));
2260 pathOffset = index;
2261 unittest.expect(subPart, unittest.equals("$arg_userId"));
2262 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als("/moments/"));
2263 pathOffset += 9;
2264 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
2265 pathOffset = path.length;
2266 unittest.expect(subPart, unittest.equals("$arg_collection"));
2267
2268 var query = (req.url).query;
2269 var queryOffset = 0;
2270 var queryMap = {};
2271 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
2272 parseBool(n) {
2273 if (n == "true") return true;
2274 if (n == "false") return false;
2275 if (n == null) return null;
2276 throw new core.ArgumentError("Invalid boolean: $n");
2277 }
2278 if (query.length > 0) {
2279 for (var part in query.split("&")) {
2280 var keyvalue = part.split("=");
2281 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
2282 }
2283 }
2284 unittest.expect(queryMap["debug"].first, unittest.equals("$arg_debug"));
2285
2286
2287 var h = {
2288 "content-type" : "application/json; charset=utf-8",
2289 };
2290 var resp = convert.JSON.encode(buildMoment());
2291 return new async.Future.value(common_test.stringResponse(200, h, resp));
2292 }), true);
2293 res.insert(arg_request, arg_userId, arg_collection, debug: arg_debug).then (unittest.expectAsync(((api.Moment response) {
2294 checkMoment(response);
2295 })));
2296 });
2297
2298 unittest.test("method--list", () {
2299
2300 var mock = new common_test.HttpServerMock();
2301 api.MomentsResourceApi res = new api.PlusApi(mock).moments;
2302 var arg_userId = "foo";
2303 var arg_collection = "foo";
2304 var arg_maxResults = 42;
2305 var arg_pageToken = "foo";
2306 var arg_targetUrl = "foo";
2307 var arg_type = "foo";
2308 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
2309 var path = (req.url).path;
2310 var pathOffset = 0;
2311 var index;
2312 var subPart;
2313 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als("/plus/v1/"));
2314 pathOffset += 9;
2315 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ als("people/"));
2316 pathOffset += 7;
2317 index = path.indexOf("/moments/", pathOffset);
2318 unittest.expect(index >= 0, unittest.isTrue);
2319 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index ));
2320 pathOffset = index;
2321 unittest.expect(subPart, unittest.equals("$arg_userId"));
2322 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als("/moments/"));
2323 pathOffset += 9;
2324 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
2325 pathOffset = path.length;
2326 unittest.expect(subPart, unittest.equals("$arg_collection"));
2327
2328 var query = (req.url).query;
2329 var queryOffset = 0;
2330 var queryMap = {};
2331 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
2332 parseBool(n) {
2333 if (n == "true") return true;
2334 if (n == "false") return false;
2335 if (n == null) return null;
2336 throw new core.ArgumentError("Invalid boolean: $n");
2337 }
2338 if (query.length > 0) {
2339 for (var part in query.split("&")) {
2340 var keyvalue = part.split("=");
2341 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
2342 }
2343 }
2344 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e quals(arg_maxResults));
2345 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
2346 unittest.expect(queryMap["targetUrl"].first, unittest.equals(arg_targetU rl));
2347 unittest.expect(queryMap["type"].first, unittest.equals(arg_type));
2348
2349
2350 var h = {
2351 "content-type" : "application/json; charset=utf-8",
2352 };
2353 var resp = convert.JSON.encode(buildMomentsFeed());
2354 return new async.Future.value(common_test.stringResponse(200, h, resp));
2355 }), true);
2356 res.list(arg_userId, arg_collection, maxResults: arg_maxResults, pageToken : arg_pageToken, targetUrl: arg_targetUrl, type: arg_type).then(unittest.expectA sync(((api.MomentsFeed response) {
2357 checkMomentsFeed(response);
2358 })));
2359 });
2360
2361 unittest.test("method--remove", () {
2362
2363 var mock = new common_test.HttpServerMock();
2364 api.MomentsResourceApi res = new api.PlusApi(mock).moments;
2365 var arg_id = "foo";
2366 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
2367 var path = (req.url).path;
2368 var pathOffset = 0;
2369 var index;
2370 var subPart;
2371 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als("/plus/v1/"));
2372 pathOffset += 9;
2373 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("moments/"));
2374 pathOffset += 8;
2375 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
2376 pathOffset = path.length;
2377 unittest.expect(subPart, unittest.equals("$arg_id"));
2378
2379 var query = (req.url).query;
2380 var queryOffset = 0;
2381 var queryMap = {};
2382 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
2383 parseBool(n) {
2384 if (n == "true") return true;
2385 if (n == "false") return false;
2386 if (n == null) return null;
2387 throw new core.ArgumentError("Invalid boolean: $n");
2388 }
2389 if (query.length > 0) {
2390 for (var part in query.split("&")) {
2391 var keyvalue = part.split("=");
2392 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
2393 }
2394 }
2395
2396
2397 var h = {
2398 "content-type" : "application/json; charset=utf-8",
2399 };
2400 var resp = "";
2401 return new async.Future.value(common_test.stringResponse(200, h, resp));
2402 }), true);
2403 res.remove(arg_id).then(unittest.expectAsync((_) {}));
2404 });
2405
2406 });
2407
2408
2409 unittest.group("resource-PeopleResourceApi", () {
2410 unittest.test("method--get", () {
2411
2412 var mock = new common_test.HttpServerMock();
2413 api.PeopleResourceApi res = new api.PlusApi(mock).people;
2414 var arg_userId = "foo";
2415 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
2416 var path = (req.url).path;
2417 var pathOffset = 0;
2418 var index;
2419 var subPart;
2420 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als("/plus/v1/"));
2421 pathOffset += 9;
2422 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ als("people/"));
2423 pathOffset += 7;
2424 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
2425 pathOffset = path.length;
2426 unittest.expect(subPart, unittest.equals("$arg_userId"));
2427
2428 var query = (req.url).query;
2429 var queryOffset = 0;
2430 var queryMap = {};
2431 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
2432 parseBool(n) {
2433 if (n == "true") return true;
2434 if (n == "false") return false;
2435 if (n == null) return null;
2436 throw new core.ArgumentError("Invalid boolean: $n");
2437 }
2438 if (query.length > 0) {
2439 for (var part in query.split("&")) {
2440 var keyvalue = part.split("=");
2441 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
2442 }
2443 }
2444
2445
2446 var h = {
2447 "content-type" : "application/json; charset=utf-8",
2448 };
2449 var resp = convert.JSON.encode(buildPerson());
2450 return new async.Future.value(common_test.stringResponse(200, h, resp));
2451 }), true);
2452 res.get(arg_userId).then(unittest.expectAsync(((api.Person response) {
2453 checkPerson(response);
2454 })));
2455 });
2456
2457 unittest.test("method--list", () {
2458
2459 var mock = new common_test.HttpServerMock();
2460 api.PeopleResourceApi res = new api.PlusApi(mock).people;
2461 var arg_userId = "foo";
2462 var arg_collection = "foo";
2463 var arg_maxResults = 42;
2464 var arg_orderBy = "foo";
2465 var arg_pageToken = "foo";
2466 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
2467 var path = (req.url).path;
2468 var pathOffset = 0;
2469 var index;
2470 var subPart;
2471 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als("/plus/v1/"));
2472 pathOffset += 9;
2473 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ als("people/"));
2474 pathOffset += 7;
2475 index = path.indexOf("/people/", pathOffset);
2476 unittest.expect(index >= 0, unittest.isTrue);
2477 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index ));
2478 pathOffset = index;
2479 unittest.expect(subPart, unittest.equals("$arg_userId"));
2480 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("/people/"));
2481 pathOffset += 8;
2482 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
2483 pathOffset = path.length;
2484 unittest.expect(subPart, unittest.equals("$arg_collection"));
2485
2486 var query = (req.url).query;
2487 var queryOffset = 0;
2488 var queryMap = {};
2489 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
2490 parseBool(n) {
2491 if (n == "true") return true;
2492 if (n == "false") return false;
2493 if (n == null) return null;
2494 throw new core.ArgumentError("Invalid boolean: $n");
2495 }
2496 if (query.length > 0) {
2497 for (var part in query.split("&")) {
2498 var keyvalue = part.split("=");
2499 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
2500 }
2501 }
2502 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e quals(arg_maxResults));
2503 unittest.expect(queryMap["orderBy"].first, unittest.equals(arg_orderBy)) ;
2504 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
2505
2506
2507 var h = {
2508 "content-type" : "application/json; charset=utf-8",
2509 };
2510 var resp = convert.JSON.encode(buildPeopleFeed());
2511 return new async.Future.value(common_test.stringResponse(200, h, resp));
2512 }), true);
2513 res.list(arg_userId, arg_collection, maxResults: arg_maxResults, orderBy: arg_orderBy, pageToken: arg_pageToken).then(unittest.expectAsync(((api.PeopleFee d response) {
2514 checkPeopleFeed(response);
2515 })));
2516 });
2517
2518 unittest.test("method--listByActivity", () {
2519
2520 var mock = new common_test.HttpServerMock();
2521 api.PeopleResourceApi res = new api.PlusApi(mock).people;
2522 var arg_activityId = "foo";
2523 var arg_collection = "foo";
2524 var arg_maxResults = 42;
2525 var arg_pageToken = "foo";
2526 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
2527 var path = (req.url).path;
2528 var pathOffset = 0;
2529 var index;
2530 var subPart;
2531 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als("/plus/v1/"));
2532 pathOffset += 9;
2533 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq uals("activities/"));
2534 pathOffset += 11;
2535 index = path.indexOf("/people/", pathOffset);
2536 unittest.expect(index >= 0, unittest.isTrue);
2537 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index ));
2538 pathOffset = index;
2539 unittest.expect(subPart, unittest.equals("$arg_activityId"));
2540 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("/people/"));
2541 pathOffset += 8;
2542 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
2543 pathOffset = path.length;
2544 unittest.expect(subPart, unittest.equals("$arg_collection"));
2545
2546 var query = (req.url).query;
2547 var queryOffset = 0;
2548 var queryMap = {};
2549 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
2550 parseBool(n) {
2551 if (n == "true") return true;
2552 if (n == "false") return false;
2553 if (n == null) return null;
2554 throw new core.ArgumentError("Invalid boolean: $n");
2555 }
2556 if (query.length > 0) {
2557 for (var part in query.split("&")) {
2558 var keyvalue = part.split("=");
2559 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
2560 }
2561 }
2562 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e quals(arg_maxResults));
2563 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
2564
2565
2566 var h = {
2567 "content-type" : "application/json; charset=utf-8",
2568 };
2569 var resp = convert.JSON.encode(buildPeopleFeed());
2570 return new async.Future.value(common_test.stringResponse(200, h, resp));
2571 }), true);
2572 res.listByActivity(arg_activityId, arg_collection, maxResults: arg_maxResu lts, pageToken: arg_pageToken).then(unittest.expectAsync(((api.PeopleFeed respon se) {
2573 checkPeopleFeed(response);
2574 })));
2575 });
2576
2577 unittest.test("method--search", () {
2578
2579 var mock = new common_test.HttpServerMock();
2580 api.PeopleResourceApi res = new api.PlusApi(mock).people;
2581 var arg_query = "foo";
2582 var arg_language = "foo";
2583 var arg_maxResults = 42;
2584 var arg_pageToken = "foo";
2585 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
2586 var path = (req.url).path;
2587 var pathOffset = 0;
2588 var index;
2589 var subPart;
2590 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ als("/plus/v1/"));
2591 pathOffset += 9;
2592 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ als("people"));
2593 pathOffset += 6;
2594
2595 var query = (req.url).query;
2596 var queryOffset = 0;
2597 var queryMap = {};
2598 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
2599 parseBool(n) {
2600 if (n == "true") return true;
2601 if (n == "false") return false;
2602 if (n == null) return null;
2603 throw new core.ArgumentError("Invalid boolean: $n");
2604 }
2605 if (query.length > 0) {
2606 for (var part in query.split("&")) {
2607 var keyvalue = part.split("=");
2608 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
2609 }
2610 }
2611 unittest.expect(queryMap["query"].first, unittest.equals(arg_query));
2612 unittest.expect(queryMap["language"].first, unittest.equals(arg_language ));
2613 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e quals(arg_maxResults));
2614 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
2615
2616
2617 var h = {
2618 "content-type" : "application/json; charset=utf-8",
2619 };
2620 var resp = convert.JSON.encode(buildPeopleFeed());
2621 return new async.Future.value(common_test.stringResponse(200, h, resp));
2622 }), true);
2623 res.search(arg_query, language: arg_language, maxResults: arg_maxResults, pageToken: arg_pageToken).then(unittest.expectAsync(((api.PeopleFeed response) {
2624 checkPeopleFeed(response);
2625 })));
2626 });
2627
2628 });
2629
2630
2631 }
2632
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698