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

Side by Side Diff: generated/googleapis/test/people/v1_test.dart

Issue 1797933002: Api-roll 33: 2016-03-14 (Closed) Base URL: git@github.com:dart-lang/googleapis.git@master
Patch Set: Added resources/*/CHANGELOG.md, addresssed comments Created 4 years, 9 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.people.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
12 import 'package:googleapis/people/v1.dart' as api;
13
14 class HttpServerMock extends http.BaseClient {
15 core.Function _callback;
16 core.bool _expectJson;
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 }
53
54 core.int buildCounterAddress = 0;
55 buildAddress() {
56 var o = new api.Address();
57 buildCounterAddress++;
58 if (buildCounterAddress < 3) {
59 o.city = "foo";
60 o.country = "foo";
61 o.countryCode = "foo";
62 o.extendedAddress = "foo";
63 o.formattedType = "foo";
64 o.formattedValue = "foo";
65 o.metadata = buildFieldMetadata();
66 o.poBox = "foo";
67 o.postalCode = "foo";
68 o.region = "foo";
69 o.streetAddress = "foo";
70 o.type = "foo";
71 }
72 buildCounterAddress--;
73 return o;
74 }
75
76 checkAddress(api.Address o) {
77 buildCounterAddress++;
78 if (buildCounterAddress < 3) {
79 unittest.expect(o.city, unittest.equals('foo'));
80 unittest.expect(o.country, unittest.equals('foo'));
81 unittest.expect(o.countryCode, unittest.equals('foo'));
82 unittest.expect(o.extendedAddress, unittest.equals('foo'));
83 unittest.expect(o.formattedType, unittest.equals('foo'));
84 unittest.expect(o.formattedValue, unittest.equals('foo'));
85 checkFieldMetadata(o.metadata);
86 unittest.expect(o.poBox, unittest.equals('foo'));
87 unittest.expect(o.postalCode, unittest.equals('foo'));
88 unittest.expect(o.region, unittest.equals('foo'));
89 unittest.expect(o.streetAddress, unittest.equals('foo'));
90 unittest.expect(o.type, unittest.equals('foo'));
91 }
92 buildCounterAddress--;
93 }
94
95 core.int buildCounterBiography = 0;
96 buildBiography() {
97 var o = new api.Biography();
98 buildCounterBiography++;
99 if (buildCounterBiography < 3) {
100 o.metadata = buildFieldMetadata();
101 o.value = "foo";
102 }
103 buildCounterBiography--;
104 return o;
105 }
106
107 checkBiography(api.Biography o) {
108 buildCounterBiography++;
109 if (buildCounterBiography < 3) {
110 checkFieldMetadata(o.metadata);
111 unittest.expect(o.value, unittest.equals('foo'));
112 }
113 buildCounterBiography--;
114 }
115
116 core.int buildCounterBirthday = 0;
117 buildBirthday() {
118 var o = new api.Birthday();
119 buildCounterBirthday++;
120 if (buildCounterBirthday < 3) {
121 o.date = buildDate();
122 o.metadata = buildFieldMetadata();
123 o.text = "foo";
124 }
125 buildCounterBirthday--;
126 return o;
127 }
128
129 checkBirthday(api.Birthday o) {
130 buildCounterBirthday++;
131 if (buildCounterBirthday < 3) {
132 checkDate(o.date);
133 checkFieldMetadata(o.metadata);
134 unittest.expect(o.text, unittest.equals('foo'));
135 }
136 buildCounterBirthday--;
137 }
138
139 core.int buildCounterBraggingRights = 0;
140 buildBraggingRights() {
141 var o = new api.BraggingRights();
142 buildCounterBraggingRights++;
143 if (buildCounterBraggingRights < 3) {
144 o.metadata = buildFieldMetadata();
145 o.value = "foo";
146 }
147 buildCounterBraggingRights--;
148 return o;
149 }
150
151 checkBraggingRights(api.BraggingRights o) {
152 buildCounterBraggingRights++;
153 if (buildCounterBraggingRights < 3) {
154 checkFieldMetadata(o.metadata);
155 unittest.expect(o.value, unittest.equals('foo'));
156 }
157 buildCounterBraggingRights--;
158 }
159
160 core.int buildCounterContactGroupMembership = 0;
161 buildContactGroupMembership() {
162 var o = new api.ContactGroupMembership();
163 buildCounterContactGroupMembership++;
164 if (buildCounterContactGroupMembership < 3) {
165 o.contactGroupId = "foo";
166 }
167 buildCounterContactGroupMembership--;
168 return o;
169 }
170
171 checkContactGroupMembership(api.ContactGroupMembership o) {
172 buildCounterContactGroupMembership++;
173 if (buildCounterContactGroupMembership < 3) {
174 unittest.expect(o.contactGroupId, unittest.equals('foo'));
175 }
176 buildCounterContactGroupMembership--;
177 }
178
179 core.int buildCounterCoverPhoto = 0;
180 buildCoverPhoto() {
181 var o = new api.CoverPhoto();
182 buildCounterCoverPhoto++;
183 if (buildCounterCoverPhoto < 3) {
184 o.default_ = true;
185 o.metadata = buildFieldMetadata();
186 o.url = "foo";
187 }
188 buildCounterCoverPhoto--;
189 return o;
190 }
191
192 checkCoverPhoto(api.CoverPhoto o) {
193 buildCounterCoverPhoto++;
194 if (buildCounterCoverPhoto < 3) {
195 unittest.expect(o.default_, unittest.isTrue);
196 checkFieldMetadata(o.metadata);
197 unittest.expect(o.url, unittest.equals('foo'));
198 }
199 buildCounterCoverPhoto--;
200 }
201
202 core.int buildCounterDate = 0;
203 buildDate() {
204 var o = new api.Date();
205 buildCounterDate++;
206 if (buildCounterDate < 3) {
207 o.day = 42;
208 o.month = 42;
209 o.year = 42;
210 }
211 buildCounterDate--;
212 return o;
213 }
214
215 checkDate(api.Date o) {
216 buildCounterDate++;
217 if (buildCounterDate < 3) {
218 unittest.expect(o.day, unittest.equals(42));
219 unittest.expect(o.month, unittest.equals(42));
220 unittest.expect(o.year, unittest.equals(42));
221 }
222 buildCounterDate--;
223 }
224
225 core.int buildCounterDomainMembership = 0;
226 buildDomainMembership() {
227 var o = new api.DomainMembership();
228 buildCounterDomainMembership++;
229 if (buildCounterDomainMembership < 3) {
230 o.inViewerDomain = true;
231 }
232 buildCounterDomainMembership--;
233 return o;
234 }
235
236 checkDomainMembership(api.DomainMembership o) {
237 buildCounterDomainMembership++;
238 if (buildCounterDomainMembership < 3) {
239 unittest.expect(o.inViewerDomain, unittest.isTrue);
240 }
241 buildCounterDomainMembership--;
242 }
243
244 core.int buildCounterEmailAddress = 0;
245 buildEmailAddress() {
246 var o = new api.EmailAddress();
247 buildCounterEmailAddress++;
248 if (buildCounterEmailAddress < 3) {
249 o.formattedType = "foo";
250 o.metadata = buildFieldMetadata();
251 o.type = "foo";
252 o.value = "foo";
253 }
254 buildCounterEmailAddress--;
255 return o;
256 }
257
258 checkEmailAddress(api.EmailAddress o) {
259 buildCounterEmailAddress++;
260 if (buildCounterEmailAddress < 3) {
261 unittest.expect(o.formattedType, unittest.equals('foo'));
262 checkFieldMetadata(o.metadata);
263 unittest.expect(o.type, unittest.equals('foo'));
264 unittest.expect(o.value, unittest.equals('foo'));
265 }
266 buildCounterEmailAddress--;
267 }
268
269 core.int buildCounterEvent = 0;
270 buildEvent() {
271 var o = new api.Event();
272 buildCounterEvent++;
273 if (buildCounterEvent < 3) {
274 o.date = buildDate();
275 o.formattedType = "foo";
276 o.metadata = buildFieldMetadata();
277 o.type = "foo";
278 }
279 buildCounterEvent--;
280 return o;
281 }
282
283 checkEvent(api.Event o) {
284 buildCounterEvent++;
285 if (buildCounterEvent < 3) {
286 checkDate(o.date);
287 unittest.expect(o.formattedType, unittest.equals('foo'));
288 checkFieldMetadata(o.metadata);
289 unittest.expect(o.type, unittest.equals('foo'));
290 }
291 buildCounterEvent--;
292 }
293
294 core.int buildCounterFieldMetadata = 0;
295 buildFieldMetadata() {
296 var o = new api.FieldMetadata();
297 buildCounterFieldMetadata++;
298 if (buildCounterFieldMetadata < 3) {
299 o.primary = true;
300 o.source = buildSource();
301 o.verified = true;
302 }
303 buildCounterFieldMetadata--;
304 return o;
305 }
306
307 checkFieldMetadata(api.FieldMetadata o) {
308 buildCounterFieldMetadata++;
309 if (buildCounterFieldMetadata < 3) {
310 unittest.expect(o.primary, unittest.isTrue);
311 checkSource(o.source);
312 unittest.expect(o.verified, unittest.isTrue);
313 }
314 buildCounterFieldMetadata--;
315 }
316
317 core.int buildCounterGender = 0;
318 buildGender() {
319 var o = new api.Gender();
320 buildCounterGender++;
321 if (buildCounterGender < 3) {
322 o.formattedValue = "foo";
323 o.metadata = buildFieldMetadata();
324 o.value = "foo";
325 }
326 buildCounterGender--;
327 return o;
328 }
329
330 checkGender(api.Gender o) {
331 buildCounterGender++;
332 if (buildCounterGender < 3) {
333 unittest.expect(o.formattedValue, unittest.equals('foo'));
334 checkFieldMetadata(o.metadata);
335 unittest.expect(o.value, unittest.equals('foo'));
336 }
337 buildCounterGender--;
338 }
339
340 buildUnnamed1712() {
341 var o = new core.List<api.PersonResponse>();
342 o.add(buildPersonResponse());
343 o.add(buildPersonResponse());
344 return o;
345 }
346
347 checkUnnamed1712(core.List<api.PersonResponse> o) {
348 unittest.expect(o, unittest.hasLength(2));
349 checkPersonResponse(o[0]);
350 checkPersonResponse(o[1]);
351 }
352
353 core.int buildCounterGetPeopleResponse = 0;
354 buildGetPeopleResponse() {
355 var o = new api.GetPeopleResponse();
356 buildCounterGetPeopleResponse++;
357 if (buildCounterGetPeopleResponse < 3) {
358 o.responses = buildUnnamed1712();
359 }
360 buildCounterGetPeopleResponse--;
361 return o;
362 }
363
364 checkGetPeopleResponse(api.GetPeopleResponse o) {
365 buildCounterGetPeopleResponse++;
366 if (buildCounterGetPeopleResponse < 3) {
367 checkUnnamed1712(o.responses);
368 }
369 buildCounterGetPeopleResponse--;
370 }
371
372 core.int buildCounterImClient = 0;
373 buildImClient() {
374 var o = new api.ImClient();
375 buildCounterImClient++;
376 if (buildCounterImClient < 3) {
377 o.formattedProtocol = "foo";
378 o.formattedType = "foo";
379 o.metadata = buildFieldMetadata();
380 o.protocol = "foo";
381 o.type = "foo";
382 o.username = "foo";
383 }
384 buildCounterImClient--;
385 return o;
386 }
387
388 checkImClient(api.ImClient o) {
389 buildCounterImClient++;
390 if (buildCounterImClient < 3) {
391 unittest.expect(o.formattedProtocol, unittest.equals('foo'));
392 unittest.expect(o.formattedType, unittest.equals('foo'));
393 checkFieldMetadata(o.metadata);
394 unittest.expect(o.protocol, unittest.equals('foo'));
395 unittest.expect(o.type, unittest.equals('foo'));
396 unittest.expect(o.username, unittest.equals('foo'));
397 }
398 buildCounterImClient--;
399 }
400
401 core.int buildCounterInterest = 0;
402 buildInterest() {
403 var o = new api.Interest();
404 buildCounterInterest++;
405 if (buildCounterInterest < 3) {
406 o.metadata = buildFieldMetadata();
407 o.value = "foo";
408 }
409 buildCounterInterest--;
410 return o;
411 }
412
413 checkInterest(api.Interest o) {
414 buildCounterInterest++;
415 if (buildCounterInterest < 3) {
416 checkFieldMetadata(o.metadata);
417 unittest.expect(o.value, unittest.equals('foo'));
418 }
419 buildCounterInterest--;
420 }
421
422 buildUnnamed1713() {
423 var o = new core.List<api.Person>();
424 o.add(buildPerson());
425 o.add(buildPerson());
426 return o;
427 }
428
429 checkUnnamed1713(core.List<api.Person> o) {
430 unittest.expect(o, unittest.hasLength(2));
431 checkPerson(o[0]);
432 checkPerson(o[1]);
433 }
434
435 core.int buildCounterListConnectionsResponse = 0;
436 buildListConnectionsResponse() {
437 var o = new api.ListConnectionsResponse();
438 buildCounterListConnectionsResponse++;
439 if (buildCounterListConnectionsResponse < 3) {
440 o.connections = buildUnnamed1713();
441 o.nextPageToken = "foo";
442 o.nextSyncToken = "foo";
443 }
444 buildCounterListConnectionsResponse--;
445 return o;
446 }
447
448 checkListConnectionsResponse(api.ListConnectionsResponse o) {
449 buildCounterListConnectionsResponse++;
450 if (buildCounterListConnectionsResponse < 3) {
451 checkUnnamed1713(o.connections);
452 unittest.expect(o.nextPageToken, unittest.equals('foo'));
453 unittest.expect(o.nextSyncToken, unittest.equals('foo'));
454 }
455 buildCounterListConnectionsResponse--;
456 }
457
458 core.int buildCounterLocale = 0;
459 buildLocale() {
460 var o = new api.Locale();
461 buildCounterLocale++;
462 if (buildCounterLocale < 3) {
463 o.metadata = buildFieldMetadata();
464 o.value = "foo";
465 }
466 buildCounterLocale--;
467 return o;
468 }
469
470 checkLocale(api.Locale o) {
471 buildCounterLocale++;
472 if (buildCounterLocale < 3) {
473 checkFieldMetadata(o.metadata);
474 unittest.expect(o.value, unittest.equals('foo'));
475 }
476 buildCounterLocale--;
477 }
478
479 core.int buildCounterMembership = 0;
480 buildMembership() {
481 var o = new api.Membership();
482 buildCounterMembership++;
483 if (buildCounterMembership < 3) {
484 o.contactGroupMembership = buildContactGroupMembership();
485 o.domainMembership = buildDomainMembership();
486 o.metadata = buildFieldMetadata();
487 }
488 buildCounterMembership--;
489 return o;
490 }
491
492 checkMembership(api.Membership o) {
493 buildCounterMembership++;
494 if (buildCounterMembership < 3) {
495 checkContactGroupMembership(o.contactGroupMembership);
496 checkDomainMembership(o.domainMembership);
497 checkFieldMetadata(o.metadata);
498 }
499 buildCounterMembership--;
500 }
501
502 core.int buildCounterName = 0;
503 buildName() {
504 var o = new api.Name();
505 buildCounterName++;
506 if (buildCounterName < 3) {
507 o.displayName = "foo";
508 o.familyName = "foo";
509 o.givenName = "foo";
510 o.honorificPrefix = "foo";
511 o.honorificSuffix = "foo";
512 o.metadata = buildFieldMetadata();
513 o.middleName = "foo";
514 o.phoneticFamilyName = "foo";
515 o.phoneticGivenName = "foo";
516 o.phoneticHonorificPrefix = "foo";
517 o.phoneticHonorificSuffix = "foo";
518 o.phoneticMiddleName = "foo";
519 }
520 buildCounterName--;
521 return o;
522 }
523
524 checkName(api.Name o) {
525 buildCounterName++;
526 if (buildCounterName < 3) {
527 unittest.expect(o.displayName, unittest.equals('foo'));
528 unittest.expect(o.familyName, unittest.equals('foo'));
529 unittest.expect(o.givenName, unittest.equals('foo'));
530 unittest.expect(o.honorificPrefix, unittest.equals('foo'));
531 unittest.expect(o.honorificSuffix, unittest.equals('foo'));
532 checkFieldMetadata(o.metadata);
533 unittest.expect(o.middleName, unittest.equals('foo'));
534 unittest.expect(o.phoneticFamilyName, unittest.equals('foo'));
535 unittest.expect(o.phoneticGivenName, unittest.equals('foo'));
536 unittest.expect(o.phoneticHonorificPrefix, unittest.equals('foo'));
537 unittest.expect(o.phoneticHonorificSuffix, unittest.equals('foo'));
538 unittest.expect(o.phoneticMiddleName, unittest.equals('foo'));
539 }
540 buildCounterName--;
541 }
542
543 core.int buildCounterNickname = 0;
544 buildNickname() {
545 var o = new api.Nickname();
546 buildCounterNickname++;
547 if (buildCounterNickname < 3) {
548 o.metadata = buildFieldMetadata();
549 o.type = "foo";
550 o.value = "foo";
551 }
552 buildCounterNickname--;
553 return o;
554 }
555
556 checkNickname(api.Nickname o) {
557 buildCounterNickname++;
558 if (buildCounterNickname < 3) {
559 checkFieldMetadata(o.metadata);
560 unittest.expect(o.type, unittest.equals('foo'));
561 unittest.expect(o.value, unittest.equals('foo'));
562 }
563 buildCounterNickname--;
564 }
565
566 core.int buildCounterOccupation = 0;
567 buildOccupation() {
568 var o = new api.Occupation();
569 buildCounterOccupation++;
570 if (buildCounterOccupation < 3) {
571 o.metadata = buildFieldMetadata();
572 o.value = "foo";
573 }
574 buildCounterOccupation--;
575 return o;
576 }
577
578 checkOccupation(api.Occupation o) {
579 buildCounterOccupation++;
580 if (buildCounterOccupation < 3) {
581 checkFieldMetadata(o.metadata);
582 unittest.expect(o.value, unittest.equals('foo'));
583 }
584 buildCounterOccupation--;
585 }
586
587 core.int buildCounterOrganization = 0;
588 buildOrganization() {
589 var o = new api.Organization();
590 buildCounterOrganization++;
591 if (buildCounterOrganization < 3) {
592 o.current = true;
593 o.department = "foo";
594 o.domain = "foo";
595 o.endDate = buildDate();
596 o.formattedType = "foo";
597 o.jobDescription = "foo";
598 o.location = "foo";
599 o.metadata = buildFieldMetadata();
600 o.name = "foo";
601 o.phoneticName = "foo";
602 o.startDate = buildDate();
603 o.symbol = "foo";
604 o.title = "foo";
605 o.type = "foo";
606 }
607 buildCounterOrganization--;
608 return o;
609 }
610
611 checkOrganization(api.Organization o) {
612 buildCounterOrganization++;
613 if (buildCounterOrganization < 3) {
614 unittest.expect(o.current, unittest.isTrue);
615 unittest.expect(o.department, unittest.equals('foo'));
616 unittest.expect(o.domain, unittest.equals('foo'));
617 checkDate(o.endDate);
618 unittest.expect(o.formattedType, unittest.equals('foo'));
619 unittest.expect(o.jobDescription, unittest.equals('foo'));
620 unittest.expect(o.location, unittest.equals('foo'));
621 checkFieldMetadata(o.metadata);
622 unittest.expect(o.name, unittest.equals('foo'));
623 unittest.expect(o.phoneticName, unittest.equals('foo'));
624 checkDate(o.startDate);
625 unittest.expect(o.symbol, unittest.equals('foo'));
626 unittest.expect(o.title, unittest.equals('foo'));
627 unittest.expect(o.type, unittest.equals('foo'));
628 }
629 buildCounterOrganization--;
630 }
631
632 buildUnnamed1714() {
633 var o = new core.List<api.Address>();
634 o.add(buildAddress());
635 o.add(buildAddress());
636 return o;
637 }
638
639 checkUnnamed1714(core.List<api.Address> o) {
640 unittest.expect(o, unittest.hasLength(2));
641 checkAddress(o[0]);
642 checkAddress(o[1]);
643 }
644
645 buildUnnamed1715() {
646 var o = new core.List<api.Biography>();
647 o.add(buildBiography());
648 o.add(buildBiography());
649 return o;
650 }
651
652 checkUnnamed1715(core.List<api.Biography> o) {
653 unittest.expect(o, unittest.hasLength(2));
654 checkBiography(o[0]);
655 checkBiography(o[1]);
656 }
657
658 buildUnnamed1716() {
659 var o = new core.List<api.Birthday>();
660 o.add(buildBirthday());
661 o.add(buildBirthday());
662 return o;
663 }
664
665 checkUnnamed1716(core.List<api.Birthday> o) {
666 unittest.expect(o, unittest.hasLength(2));
667 checkBirthday(o[0]);
668 checkBirthday(o[1]);
669 }
670
671 buildUnnamed1717() {
672 var o = new core.List<api.BraggingRights>();
673 o.add(buildBraggingRights());
674 o.add(buildBraggingRights());
675 return o;
676 }
677
678 checkUnnamed1717(core.List<api.BraggingRights> o) {
679 unittest.expect(o, unittest.hasLength(2));
680 checkBraggingRights(o[0]);
681 checkBraggingRights(o[1]);
682 }
683
684 buildUnnamed1718() {
685 var o = new core.List<api.CoverPhoto>();
686 o.add(buildCoverPhoto());
687 o.add(buildCoverPhoto());
688 return o;
689 }
690
691 checkUnnamed1718(core.List<api.CoverPhoto> o) {
692 unittest.expect(o, unittest.hasLength(2));
693 checkCoverPhoto(o[0]);
694 checkCoverPhoto(o[1]);
695 }
696
697 buildUnnamed1719() {
698 var o = new core.List<api.EmailAddress>();
699 o.add(buildEmailAddress());
700 o.add(buildEmailAddress());
701 return o;
702 }
703
704 checkUnnamed1719(core.List<api.EmailAddress> o) {
705 unittest.expect(o, unittest.hasLength(2));
706 checkEmailAddress(o[0]);
707 checkEmailAddress(o[1]);
708 }
709
710 buildUnnamed1720() {
711 var o = new core.List<api.Event>();
712 o.add(buildEvent());
713 o.add(buildEvent());
714 return o;
715 }
716
717 checkUnnamed1720(core.List<api.Event> o) {
718 unittest.expect(o, unittest.hasLength(2));
719 checkEvent(o[0]);
720 checkEvent(o[1]);
721 }
722
723 buildUnnamed1721() {
724 var o = new core.List<api.Gender>();
725 o.add(buildGender());
726 o.add(buildGender());
727 return o;
728 }
729
730 checkUnnamed1721(core.List<api.Gender> o) {
731 unittest.expect(o, unittest.hasLength(2));
732 checkGender(o[0]);
733 checkGender(o[1]);
734 }
735
736 buildUnnamed1722() {
737 var o = new core.List<api.ImClient>();
738 o.add(buildImClient());
739 o.add(buildImClient());
740 return o;
741 }
742
743 checkUnnamed1722(core.List<api.ImClient> o) {
744 unittest.expect(o, unittest.hasLength(2));
745 checkImClient(o[0]);
746 checkImClient(o[1]);
747 }
748
749 buildUnnamed1723() {
750 var o = new core.List<api.Interest>();
751 o.add(buildInterest());
752 o.add(buildInterest());
753 return o;
754 }
755
756 checkUnnamed1723(core.List<api.Interest> o) {
757 unittest.expect(o, unittest.hasLength(2));
758 checkInterest(o[0]);
759 checkInterest(o[1]);
760 }
761
762 buildUnnamed1724() {
763 var o = new core.List<api.Locale>();
764 o.add(buildLocale());
765 o.add(buildLocale());
766 return o;
767 }
768
769 checkUnnamed1724(core.List<api.Locale> o) {
770 unittest.expect(o, unittest.hasLength(2));
771 checkLocale(o[0]);
772 checkLocale(o[1]);
773 }
774
775 buildUnnamed1725() {
776 var o = new core.List<api.Membership>();
777 o.add(buildMembership());
778 o.add(buildMembership());
779 return o;
780 }
781
782 checkUnnamed1725(core.List<api.Membership> o) {
783 unittest.expect(o, unittest.hasLength(2));
784 checkMembership(o[0]);
785 checkMembership(o[1]);
786 }
787
788 buildUnnamed1726() {
789 var o = new core.List<api.Name>();
790 o.add(buildName());
791 o.add(buildName());
792 return o;
793 }
794
795 checkUnnamed1726(core.List<api.Name> o) {
796 unittest.expect(o, unittest.hasLength(2));
797 checkName(o[0]);
798 checkName(o[1]);
799 }
800
801 buildUnnamed1727() {
802 var o = new core.List<api.Nickname>();
803 o.add(buildNickname());
804 o.add(buildNickname());
805 return o;
806 }
807
808 checkUnnamed1727(core.List<api.Nickname> o) {
809 unittest.expect(o, unittest.hasLength(2));
810 checkNickname(o[0]);
811 checkNickname(o[1]);
812 }
813
814 buildUnnamed1728() {
815 var o = new core.List<api.Occupation>();
816 o.add(buildOccupation());
817 o.add(buildOccupation());
818 return o;
819 }
820
821 checkUnnamed1728(core.List<api.Occupation> o) {
822 unittest.expect(o, unittest.hasLength(2));
823 checkOccupation(o[0]);
824 checkOccupation(o[1]);
825 }
826
827 buildUnnamed1729() {
828 var o = new core.List<api.Organization>();
829 o.add(buildOrganization());
830 o.add(buildOrganization());
831 return o;
832 }
833
834 checkUnnamed1729(core.List<api.Organization> o) {
835 unittest.expect(o, unittest.hasLength(2));
836 checkOrganization(o[0]);
837 checkOrganization(o[1]);
838 }
839
840 buildUnnamed1730() {
841 var o = new core.List<api.PhoneNumber>();
842 o.add(buildPhoneNumber());
843 o.add(buildPhoneNumber());
844 return o;
845 }
846
847 checkUnnamed1730(core.List<api.PhoneNumber> o) {
848 unittest.expect(o, unittest.hasLength(2));
849 checkPhoneNumber(o[0]);
850 checkPhoneNumber(o[1]);
851 }
852
853 buildUnnamed1731() {
854 var o = new core.List<api.Photo>();
855 o.add(buildPhoto());
856 o.add(buildPhoto());
857 return o;
858 }
859
860 checkUnnamed1731(core.List<api.Photo> o) {
861 unittest.expect(o, unittest.hasLength(2));
862 checkPhoto(o[0]);
863 checkPhoto(o[1]);
864 }
865
866 buildUnnamed1732() {
867 var o = new core.List<api.Relation>();
868 o.add(buildRelation());
869 o.add(buildRelation());
870 return o;
871 }
872
873 checkUnnamed1732(core.List<api.Relation> o) {
874 unittest.expect(o, unittest.hasLength(2));
875 checkRelation(o[0]);
876 checkRelation(o[1]);
877 }
878
879 buildUnnamed1733() {
880 var o = new core.List<api.RelationshipInterest>();
881 o.add(buildRelationshipInterest());
882 o.add(buildRelationshipInterest());
883 return o;
884 }
885
886 checkUnnamed1733(core.List<api.RelationshipInterest> o) {
887 unittest.expect(o, unittest.hasLength(2));
888 checkRelationshipInterest(o[0]);
889 checkRelationshipInterest(o[1]);
890 }
891
892 buildUnnamed1734() {
893 var o = new core.List<api.RelationshipStatus>();
894 o.add(buildRelationshipStatus());
895 o.add(buildRelationshipStatus());
896 return o;
897 }
898
899 checkUnnamed1734(core.List<api.RelationshipStatus> o) {
900 unittest.expect(o, unittest.hasLength(2));
901 checkRelationshipStatus(o[0]);
902 checkRelationshipStatus(o[1]);
903 }
904
905 buildUnnamed1735() {
906 var o = new core.List<api.Residence>();
907 o.add(buildResidence());
908 o.add(buildResidence());
909 return o;
910 }
911
912 checkUnnamed1735(core.List<api.Residence> o) {
913 unittest.expect(o, unittest.hasLength(2));
914 checkResidence(o[0]);
915 checkResidence(o[1]);
916 }
917
918 buildUnnamed1736() {
919 var o = new core.List<api.Skill>();
920 o.add(buildSkill());
921 o.add(buildSkill());
922 return o;
923 }
924
925 checkUnnamed1736(core.List<api.Skill> o) {
926 unittest.expect(o, unittest.hasLength(2));
927 checkSkill(o[0]);
928 checkSkill(o[1]);
929 }
930
931 buildUnnamed1737() {
932 var o = new core.List<api.Tagline>();
933 o.add(buildTagline());
934 o.add(buildTagline());
935 return o;
936 }
937
938 checkUnnamed1737(core.List<api.Tagline> o) {
939 unittest.expect(o, unittest.hasLength(2));
940 checkTagline(o[0]);
941 checkTagline(o[1]);
942 }
943
944 buildUnnamed1738() {
945 var o = new core.List<api.Url>();
946 o.add(buildUrl());
947 o.add(buildUrl());
948 return o;
949 }
950
951 checkUnnamed1738(core.List<api.Url> o) {
952 unittest.expect(o, unittest.hasLength(2));
953 checkUrl(o[0]);
954 checkUrl(o[1]);
955 }
956
957 core.int buildCounterPerson = 0;
958 buildPerson() {
959 var o = new api.Person();
960 buildCounterPerson++;
961 if (buildCounterPerson < 3) {
962 o.addresses = buildUnnamed1714();
963 o.ageRange = "foo";
964 o.biographies = buildUnnamed1715();
965 o.birthdays = buildUnnamed1716();
966 o.braggingRights = buildUnnamed1717();
967 o.coverPhotos = buildUnnamed1718();
968 o.emailAddresses = buildUnnamed1719();
969 o.etag = "foo";
970 o.events = buildUnnamed1720();
971 o.genders = buildUnnamed1721();
972 o.imClients = buildUnnamed1722();
973 o.interests = buildUnnamed1723();
974 o.locales = buildUnnamed1724();
975 o.memberships = buildUnnamed1725();
976 o.metadata = buildPersonMetadata();
977 o.names = buildUnnamed1726();
978 o.nicknames = buildUnnamed1727();
979 o.occupations = buildUnnamed1728();
980 o.organizations = buildUnnamed1729();
981 o.phoneNumbers = buildUnnamed1730();
982 o.photos = buildUnnamed1731();
983 o.relations = buildUnnamed1732();
984 o.relationshipInterests = buildUnnamed1733();
985 o.relationshipStatuses = buildUnnamed1734();
986 o.residences = buildUnnamed1735();
987 o.resourceName = "foo";
988 o.skills = buildUnnamed1736();
989 o.taglines = buildUnnamed1737();
990 o.urls = buildUnnamed1738();
991 }
992 buildCounterPerson--;
993 return o;
994 }
995
996 checkPerson(api.Person o) {
997 buildCounterPerson++;
998 if (buildCounterPerson < 3) {
999 checkUnnamed1714(o.addresses);
1000 unittest.expect(o.ageRange, unittest.equals('foo'));
1001 checkUnnamed1715(o.biographies);
1002 checkUnnamed1716(o.birthdays);
1003 checkUnnamed1717(o.braggingRights);
1004 checkUnnamed1718(o.coverPhotos);
1005 checkUnnamed1719(o.emailAddresses);
1006 unittest.expect(o.etag, unittest.equals('foo'));
1007 checkUnnamed1720(o.events);
1008 checkUnnamed1721(o.genders);
1009 checkUnnamed1722(o.imClients);
1010 checkUnnamed1723(o.interests);
1011 checkUnnamed1724(o.locales);
1012 checkUnnamed1725(o.memberships);
1013 checkPersonMetadata(o.metadata);
1014 checkUnnamed1726(o.names);
1015 checkUnnamed1727(o.nicknames);
1016 checkUnnamed1728(o.occupations);
1017 checkUnnamed1729(o.organizations);
1018 checkUnnamed1730(o.phoneNumbers);
1019 checkUnnamed1731(o.photos);
1020 checkUnnamed1732(o.relations);
1021 checkUnnamed1733(o.relationshipInterests);
1022 checkUnnamed1734(o.relationshipStatuses);
1023 checkUnnamed1735(o.residences);
1024 unittest.expect(o.resourceName, unittest.equals('foo'));
1025 checkUnnamed1736(o.skills);
1026 checkUnnamed1737(o.taglines);
1027 checkUnnamed1738(o.urls);
1028 }
1029 buildCounterPerson--;
1030 }
1031
1032 buildUnnamed1739() {
1033 var o = new core.List<core.String>();
1034 o.add("foo");
1035 o.add("foo");
1036 return o;
1037 }
1038
1039 checkUnnamed1739(core.List<core.String> o) {
1040 unittest.expect(o, unittest.hasLength(2));
1041 unittest.expect(o[0], unittest.equals('foo'));
1042 unittest.expect(o[1], unittest.equals('foo'));
1043 }
1044
1045 buildUnnamed1740() {
1046 var o = new core.List<api.Source>();
1047 o.add(buildSource());
1048 o.add(buildSource());
1049 return o;
1050 }
1051
1052 checkUnnamed1740(core.List<api.Source> o) {
1053 unittest.expect(o, unittest.hasLength(2));
1054 checkSource(o[0]);
1055 checkSource(o[1]);
1056 }
1057
1058 core.int buildCounterPersonMetadata = 0;
1059 buildPersonMetadata() {
1060 var o = new api.PersonMetadata();
1061 buildCounterPersonMetadata++;
1062 if (buildCounterPersonMetadata < 3) {
1063 o.deleted = true;
1064 o.objectType = "foo";
1065 o.previousResourceNames = buildUnnamed1739();
1066 o.sources = buildUnnamed1740();
1067 }
1068 buildCounterPersonMetadata--;
1069 return o;
1070 }
1071
1072 checkPersonMetadata(api.PersonMetadata o) {
1073 buildCounterPersonMetadata++;
1074 if (buildCounterPersonMetadata < 3) {
1075 unittest.expect(o.deleted, unittest.isTrue);
1076 unittest.expect(o.objectType, unittest.equals('foo'));
1077 checkUnnamed1739(o.previousResourceNames);
1078 checkUnnamed1740(o.sources);
1079 }
1080 buildCounterPersonMetadata--;
1081 }
1082
1083 core.int buildCounterPersonResponse = 0;
1084 buildPersonResponse() {
1085 var o = new api.PersonResponse();
1086 buildCounterPersonResponse++;
1087 if (buildCounterPersonResponse < 3) {
1088 o.httpStatusCode = 42;
1089 o.person = buildPerson();
1090 o.requestedResourceName = "foo";
1091 }
1092 buildCounterPersonResponse--;
1093 return o;
1094 }
1095
1096 checkPersonResponse(api.PersonResponse o) {
1097 buildCounterPersonResponse++;
1098 if (buildCounterPersonResponse < 3) {
1099 unittest.expect(o.httpStatusCode, unittest.equals(42));
1100 checkPerson(o.person);
1101 unittest.expect(o.requestedResourceName, unittest.equals('foo'));
1102 }
1103 buildCounterPersonResponse--;
1104 }
1105
1106 core.int buildCounterPhoneNumber = 0;
1107 buildPhoneNumber() {
1108 var o = new api.PhoneNumber();
1109 buildCounterPhoneNumber++;
1110 if (buildCounterPhoneNumber < 3) {
1111 o.canonicalForm = "foo";
1112 o.formattedType = "foo";
1113 o.metadata = buildFieldMetadata();
1114 o.type = "foo";
1115 o.value = "foo";
1116 }
1117 buildCounterPhoneNumber--;
1118 return o;
1119 }
1120
1121 checkPhoneNumber(api.PhoneNumber o) {
1122 buildCounterPhoneNumber++;
1123 if (buildCounterPhoneNumber < 3) {
1124 unittest.expect(o.canonicalForm, unittest.equals('foo'));
1125 unittest.expect(o.formattedType, unittest.equals('foo'));
1126 checkFieldMetadata(o.metadata);
1127 unittest.expect(o.type, unittest.equals('foo'));
1128 unittest.expect(o.value, unittest.equals('foo'));
1129 }
1130 buildCounterPhoneNumber--;
1131 }
1132
1133 core.int buildCounterPhoto = 0;
1134 buildPhoto() {
1135 var o = new api.Photo();
1136 buildCounterPhoto++;
1137 if (buildCounterPhoto < 3) {
1138 o.metadata = buildFieldMetadata();
1139 o.url = "foo";
1140 }
1141 buildCounterPhoto--;
1142 return o;
1143 }
1144
1145 checkPhoto(api.Photo o) {
1146 buildCounterPhoto++;
1147 if (buildCounterPhoto < 3) {
1148 checkFieldMetadata(o.metadata);
1149 unittest.expect(o.url, unittest.equals('foo'));
1150 }
1151 buildCounterPhoto--;
1152 }
1153
1154 core.int buildCounterRelation = 0;
1155 buildRelation() {
1156 var o = new api.Relation();
1157 buildCounterRelation++;
1158 if (buildCounterRelation < 3) {
1159 o.formattedType = "foo";
1160 o.metadata = buildFieldMetadata();
1161 o.person = "foo";
1162 o.type = "foo";
1163 }
1164 buildCounterRelation--;
1165 return o;
1166 }
1167
1168 checkRelation(api.Relation o) {
1169 buildCounterRelation++;
1170 if (buildCounterRelation < 3) {
1171 unittest.expect(o.formattedType, unittest.equals('foo'));
1172 checkFieldMetadata(o.metadata);
1173 unittest.expect(o.person, unittest.equals('foo'));
1174 unittest.expect(o.type, unittest.equals('foo'));
1175 }
1176 buildCounterRelation--;
1177 }
1178
1179 core.int buildCounterRelationshipInterest = 0;
1180 buildRelationshipInterest() {
1181 var o = new api.RelationshipInterest();
1182 buildCounterRelationshipInterest++;
1183 if (buildCounterRelationshipInterest < 3) {
1184 o.formattedValue = "foo";
1185 o.metadata = buildFieldMetadata();
1186 o.value = "foo";
1187 }
1188 buildCounterRelationshipInterest--;
1189 return o;
1190 }
1191
1192 checkRelationshipInterest(api.RelationshipInterest o) {
1193 buildCounterRelationshipInterest++;
1194 if (buildCounterRelationshipInterest < 3) {
1195 unittest.expect(o.formattedValue, unittest.equals('foo'));
1196 checkFieldMetadata(o.metadata);
1197 unittest.expect(o.value, unittest.equals('foo'));
1198 }
1199 buildCounterRelationshipInterest--;
1200 }
1201
1202 core.int buildCounterRelationshipStatus = 0;
1203 buildRelationshipStatus() {
1204 var o = new api.RelationshipStatus();
1205 buildCounterRelationshipStatus++;
1206 if (buildCounterRelationshipStatus < 3) {
1207 o.formattedValue = "foo";
1208 o.metadata = buildFieldMetadata();
1209 o.value = "foo";
1210 }
1211 buildCounterRelationshipStatus--;
1212 return o;
1213 }
1214
1215 checkRelationshipStatus(api.RelationshipStatus o) {
1216 buildCounterRelationshipStatus++;
1217 if (buildCounterRelationshipStatus < 3) {
1218 unittest.expect(o.formattedValue, unittest.equals('foo'));
1219 checkFieldMetadata(o.metadata);
1220 unittest.expect(o.value, unittest.equals('foo'));
1221 }
1222 buildCounterRelationshipStatus--;
1223 }
1224
1225 core.int buildCounterResidence = 0;
1226 buildResidence() {
1227 var o = new api.Residence();
1228 buildCounterResidence++;
1229 if (buildCounterResidence < 3) {
1230 o.current = true;
1231 o.metadata = buildFieldMetadata();
1232 o.value = "foo";
1233 }
1234 buildCounterResidence--;
1235 return o;
1236 }
1237
1238 checkResidence(api.Residence o) {
1239 buildCounterResidence++;
1240 if (buildCounterResidence < 3) {
1241 unittest.expect(o.current, unittest.isTrue);
1242 checkFieldMetadata(o.metadata);
1243 unittest.expect(o.value, unittest.equals('foo'));
1244 }
1245 buildCounterResidence--;
1246 }
1247
1248 core.int buildCounterSkill = 0;
1249 buildSkill() {
1250 var o = new api.Skill();
1251 buildCounterSkill++;
1252 if (buildCounterSkill < 3) {
1253 o.metadata = buildFieldMetadata();
1254 o.value = "foo";
1255 }
1256 buildCounterSkill--;
1257 return o;
1258 }
1259
1260 checkSkill(api.Skill o) {
1261 buildCounterSkill++;
1262 if (buildCounterSkill < 3) {
1263 checkFieldMetadata(o.metadata);
1264 unittest.expect(o.value, unittest.equals('foo'));
1265 }
1266 buildCounterSkill--;
1267 }
1268
1269 core.int buildCounterSource = 0;
1270 buildSource() {
1271 var o = new api.Source();
1272 buildCounterSource++;
1273 if (buildCounterSource < 3) {
1274 o.id = "foo";
1275 o.type = "foo";
1276 }
1277 buildCounterSource--;
1278 return o;
1279 }
1280
1281 checkSource(api.Source o) {
1282 buildCounterSource++;
1283 if (buildCounterSource < 3) {
1284 unittest.expect(o.id, unittest.equals('foo'));
1285 unittest.expect(o.type, unittest.equals('foo'));
1286 }
1287 buildCounterSource--;
1288 }
1289
1290 core.int buildCounterTagline = 0;
1291 buildTagline() {
1292 var o = new api.Tagline();
1293 buildCounterTagline++;
1294 if (buildCounterTagline < 3) {
1295 o.metadata = buildFieldMetadata();
1296 o.value = "foo";
1297 }
1298 buildCounterTagline--;
1299 return o;
1300 }
1301
1302 checkTagline(api.Tagline o) {
1303 buildCounterTagline++;
1304 if (buildCounterTagline < 3) {
1305 checkFieldMetadata(o.metadata);
1306 unittest.expect(o.value, unittest.equals('foo'));
1307 }
1308 buildCounterTagline--;
1309 }
1310
1311 core.int buildCounterUrl = 0;
1312 buildUrl() {
1313 var o = new api.Url();
1314 buildCounterUrl++;
1315 if (buildCounterUrl < 3) {
1316 o.formattedType = "foo";
1317 o.metadata = buildFieldMetadata();
1318 o.type = "foo";
1319 o.value = "foo";
1320 }
1321 buildCounterUrl--;
1322 return o;
1323 }
1324
1325 checkUrl(api.Url o) {
1326 buildCounterUrl++;
1327 if (buildCounterUrl < 3) {
1328 unittest.expect(o.formattedType, unittest.equals('foo'));
1329 checkFieldMetadata(o.metadata);
1330 unittest.expect(o.type, unittest.equals('foo'));
1331 unittest.expect(o.value, unittest.equals('foo'));
1332 }
1333 buildCounterUrl--;
1334 }
1335
1336 buildUnnamed1741() {
1337 var o = new core.List<core.String>();
1338 o.add("foo");
1339 o.add("foo");
1340 return o;
1341 }
1342
1343 checkUnnamed1741(core.List<core.String> o) {
1344 unittest.expect(o, unittest.hasLength(2));
1345 unittest.expect(o[0], unittest.equals('foo'));
1346 unittest.expect(o[1], unittest.equals('foo'));
1347 }
1348
1349
1350 main() {
1351 unittest.group("obj-schema-Address", () {
1352 unittest.test("to-json--from-json", () {
1353 var o = buildAddress();
1354 var od = new api.Address.fromJson(o.toJson());
1355 checkAddress(od);
1356 });
1357 });
1358
1359
1360 unittest.group("obj-schema-Biography", () {
1361 unittest.test("to-json--from-json", () {
1362 var o = buildBiography();
1363 var od = new api.Biography.fromJson(o.toJson());
1364 checkBiography(od);
1365 });
1366 });
1367
1368
1369 unittest.group("obj-schema-Birthday", () {
1370 unittest.test("to-json--from-json", () {
1371 var o = buildBirthday();
1372 var od = new api.Birthday.fromJson(o.toJson());
1373 checkBirthday(od);
1374 });
1375 });
1376
1377
1378 unittest.group("obj-schema-BraggingRights", () {
1379 unittest.test("to-json--from-json", () {
1380 var o = buildBraggingRights();
1381 var od = new api.BraggingRights.fromJson(o.toJson());
1382 checkBraggingRights(od);
1383 });
1384 });
1385
1386
1387 unittest.group("obj-schema-ContactGroupMembership", () {
1388 unittest.test("to-json--from-json", () {
1389 var o = buildContactGroupMembership();
1390 var od = new api.ContactGroupMembership.fromJson(o.toJson());
1391 checkContactGroupMembership(od);
1392 });
1393 });
1394
1395
1396 unittest.group("obj-schema-CoverPhoto", () {
1397 unittest.test("to-json--from-json", () {
1398 var o = buildCoverPhoto();
1399 var od = new api.CoverPhoto.fromJson(o.toJson());
1400 checkCoverPhoto(od);
1401 });
1402 });
1403
1404
1405 unittest.group("obj-schema-Date", () {
1406 unittest.test("to-json--from-json", () {
1407 var o = buildDate();
1408 var od = new api.Date.fromJson(o.toJson());
1409 checkDate(od);
1410 });
1411 });
1412
1413
1414 unittest.group("obj-schema-DomainMembership", () {
1415 unittest.test("to-json--from-json", () {
1416 var o = buildDomainMembership();
1417 var od = new api.DomainMembership.fromJson(o.toJson());
1418 checkDomainMembership(od);
1419 });
1420 });
1421
1422
1423 unittest.group("obj-schema-EmailAddress", () {
1424 unittest.test("to-json--from-json", () {
1425 var o = buildEmailAddress();
1426 var od = new api.EmailAddress.fromJson(o.toJson());
1427 checkEmailAddress(od);
1428 });
1429 });
1430
1431
1432 unittest.group("obj-schema-Event", () {
1433 unittest.test("to-json--from-json", () {
1434 var o = buildEvent();
1435 var od = new api.Event.fromJson(o.toJson());
1436 checkEvent(od);
1437 });
1438 });
1439
1440
1441 unittest.group("obj-schema-FieldMetadata", () {
1442 unittest.test("to-json--from-json", () {
1443 var o = buildFieldMetadata();
1444 var od = new api.FieldMetadata.fromJson(o.toJson());
1445 checkFieldMetadata(od);
1446 });
1447 });
1448
1449
1450 unittest.group("obj-schema-Gender", () {
1451 unittest.test("to-json--from-json", () {
1452 var o = buildGender();
1453 var od = new api.Gender.fromJson(o.toJson());
1454 checkGender(od);
1455 });
1456 });
1457
1458
1459 unittest.group("obj-schema-GetPeopleResponse", () {
1460 unittest.test("to-json--from-json", () {
1461 var o = buildGetPeopleResponse();
1462 var od = new api.GetPeopleResponse.fromJson(o.toJson());
1463 checkGetPeopleResponse(od);
1464 });
1465 });
1466
1467
1468 unittest.group("obj-schema-ImClient", () {
1469 unittest.test("to-json--from-json", () {
1470 var o = buildImClient();
1471 var od = new api.ImClient.fromJson(o.toJson());
1472 checkImClient(od);
1473 });
1474 });
1475
1476
1477 unittest.group("obj-schema-Interest", () {
1478 unittest.test("to-json--from-json", () {
1479 var o = buildInterest();
1480 var od = new api.Interest.fromJson(o.toJson());
1481 checkInterest(od);
1482 });
1483 });
1484
1485
1486 unittest.group("obj-schema-ListConnectionsResponse", () {
1487 unittest.test("to-json--from-json", () {
1488 var o = buildListConnectionsResponse();
1489 var od = new api.ListConnectionsResponse.fromJson(o.toJson());
1490 checkListConnectionsResponse(od);
1491 });
1492 });
1493
1494
1495 unittest.group("obj-schema-Locale", () {
1496 unittest.test("to-json--from-json", () {
1497 var o = buildLocale();
1498 var od = new api.Locale.fromJson(o.toJson());
1499 checkLocale(od);
1500 });
1501 });
1502
1503
1504 unittest.group("obj-schema-Membership", () {
1505 unittest.test("to-json--from-json", () {
1506 var o = buildMembership();
1507 var od = new api.Membership.fromJson(o.toJson());
1508 checkMembership(od);
1509 });
1510 });
1511
1512
1513 unittest.group("obj-schema-Name", () {
1514 unittest.test("to-json--from-json", () {
1515 var o = buildName();
1516 var od = new api.Name.fromJson(o.toJson());
1517 checkName(od);
1518 });
1519 });
1520
1521
1522 unittest.group("obj-schema-Nickname", () {
1523 unittest.test("to-json--from-json", () {
1524 var o = buildNickname();
1525 var od = new api.Nickname.fromJson(o.toJson());
1526 checkNickname(od);
1527 });
1528 });
1529
1530
1531 unittest.group("obj-schema-Occupation", () {
1532 unittest.test("to-json--from-json", () {
1533 var o = buildOccupation();
1534 var od = new api.Occupation.fromJson(o.toJson());
1535 checkOccupation(od);
1536 });
1537 });
1538
1539
1540 unittest.group("obj-schema-Organization", () {
1541 unittest.test("to-json--from-json", () {
1542 var o = buildOrganization();
1543 var od = new api.Organization.fromJson(o.toJson());
1544 checkOrganization(od);
1545 });
1546 });
1547
1548
1549 unittest.group("obj-schema-Person", () {
1550 unittest.test("to-json--from-json", () {
1551 var o = buildPerson();
1552 var od = new api.Person.fromJson(o.toJson());
1553 checkPerson(od);
1554 });
1555 });
1556
1557
1558 unittest.group("obj-schema-PersonMetadata", () {
1559 unittest.test("to-json--from-json", () {
1560 var o = buildPersonMetadata();
1561 var od = new api.PersonMetadata.fromJson(o.toJson());
1562 checkPersonMetadata(od);
1563 });
1564 });
1565
1566
1567 unittest.group("obj-schema-PersonResponse", () {
1568 unittest.test("to-json--from-json", () {
1569 var o = buildPersonResponse();
1570 var od = new api.PersonResponse.fromJson(o.toJson());
1571 checkPersonResponse(od);
1572 });
1573 });
1574
1575
1576 unittest.group("obj-schema-PhoneNumber", () {
1577 unittest.test("to-json--from-json", () {
1578 var o = buildPhoneNumber();
1579 var od = new api.PhoneNumber.fromJson(o.toJson());
1580 checkPhoneNumber(od);
1581 });
1582 });
1583
1584
1585 unittest.group("obj-schema-Photo", () {
1586 unittest.test("to-json--from-json", () {
1587 var o = buildPhoto();
1588 var od = new api.Photo.fromJson(o.toJson());
1589 checkPhoto(od);
1590 });
1591 });
1592
1593
1594 unittest.group("obj-schema-Relation", () {
1595 unittest.test("to-json--from-json", () {
1596 var o = buildRelation();
1597 var od = new api.Relation.fromJson(o.toJson());
1598 checkRelation(od);
1599 });
1600 });
1601
1602
1603 unittest.group("obj-schema-RelationshipInterest", () {
1604 unittest.test("to-json--from-json", () {
1605 var o = buildRelationshipInterest();
1606 var od = new api.RelationshipInterest.fromJson(o.toJson());
1607 checkRelationshipInterest(od);
1608 });
1609 });
1610
1611
1612 unittest.group("obj-schema-RelationshipStatus", () {
1613 unittest.test("to-json--from-json", () {
1614 var o = buildRelationshipStatus();
1615 var od = new api.RelationshipStatus.fromJson(o.toJson());
1616 checkRelationshipStatus(od);
1617 });
1618 });
1619
1620
1621 unittest.group("obj-schema-Residence", () {
1622 unittest.test("to-json--from-json", () {
1623 var o = buildResidence();
1624 var od = new api.Residence.fromJson(o.toJson());
1625 checkResidence(od);
1626 });
1627 });
1628
1629
1630 unittest.group("obj-schema-Skill", () {
1631 unittest.test("to-json--from-json", () {
1632 var o = buildSkill();
1633 var od = new api.Skill.fromJson(o.toJson());
1634 checkSkill(od);
1635 });
1636 });
1637
1638
1639 unittest.group("obj-schema-Source", () {
1640 unittest.test("to-json--from-json", () {
1641 var o = buildSource();
1642 var od = new api.Source.fromJson(o.toJson());
1643 checkSource(od);
1644 });
1645 });
1646
1647
1648 unittest.group("obj-schema-Tagline", () {
1649 unittest.test("to-json--from-json", () {
1650 var o = buildTagline();
1651 var od = new api.Tagline.fromJson(o.toJson());
1652 checkTagline(od);
1653 });
1654 });
1655
1656
1657 unittest.group("obj-schema-Url", () {
1658 unittest.test("to-json--from-json", () {
1659 var o = buildUrl();
1660 var od = new api.Url.fromJson(o.toJson());
1661 checkUrl(od);
1662 });
1663 });
1664
1665
1666 unittest.group("resource-PeopleResourceApi", () {
1667 unittest.test("method--get", () {
1668
1669 var mock = new HttpServerMock();
1670 api.PeopleResourceApi res = new api.PeopleApi(mock).people;
1671 var arg_resourceName = "foo";
1672 var arg_requestMask_includeField = "foo";
1673 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1674 var path = (req.url).path;
1675 var pathOffset = 0;
1676 var index;
1677 var subPart;
1678 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1679 pathOffset += 1;
1680 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/"));
1681 pathOffset += 3;
1682 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1683
1684 var query = (req.url).query;
1685 var queryOffset = 0;
1686 var queryMap = {};
1687 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1688 parseBool(n) {
1689 if (n == "true") return true;
1690 if (n == "false") return false;
1691 if (n == null) return null;
1692 throw new core.ArgumentError("Invalid boolean: $n");
1693 }
1694 if (query.length > 0) {
1695 for (var part in query.split("&")) {
1696 var keyvalue = part.split("=");
1697 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1698 }
1699 }
1700 unittest.expect(queryMap["requestMask.includeField"].first, unittest.equ als(arg_requestMask_includeField));
1701
1702
1703 var h = {
1704 "content-type" : "application/json; charset=utf-8",
1705 };
1706 var resp = convert.JSON.encode(buildPerson());
1707 return new async.Future.value(stringResponse(200, h, resp));
1708 }), true);
1709 res.get(arg_resourceName, requestMask_includeField: arg_requestMask_includ eField).then(unittest.expectAsync(((api.Person response) {
1710 checkPerson(response);
1711 })));
1712 });
1713
1714 unittest.test("method--getBatchGet", () {
1715
1716 var mock = new HttpServerMock();
1717 api.PeopleResourceApi res = new api.PeopleApi(mock).people;
1718 var arg_resourceNames = buildUnnamed1741();
1719 var arg_requestMask_includeField = "foo";
1720 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1721 var path = (req.url).path;
1722 var pathOffset = 0;
1723 var index;
1724 var subPart;
1725 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1726 pathOffset += 1;
1727 unittest.expect(path.substring(pathOffset, pathOffset + 18), unittest.eq uals("v1/people:batchGet"));
1728 pathOffset += 18;
1729
1730 var query = (req.url).query;
1731 var queryOffset = 0;
1732 var queryMap = {};
1733 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1734 parseBool(n) {
1735 if (n == "true") return true;
1736 if (n == "false") return false;
1737 if (n == null) return null;
1738 throw new core.ArgumentError("Invalid boolean: $n");
1739 }
1740 if (query.length > 0) {
1741 for (var part in query.split("&")) {
1742 var keyvalue = part.split("=");
1743 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1744 }
1745 }
1746 unittest.expect(queryMap["resourceNames"], unittest.equals(arg_resourceN ames));
1747 unittest.expect(queryMap["requestMask.includeField"].first, unittest.equ als(arg_requestMask_includeField));
1748
1749
1750 var h = {
1751 "content-type" : "application/json; charset=utf-8",
1752 };
1753 var resp = convert.JSON.encode(buildGetPeopleResponse());
1754 return new async.Future.value(stringResponse(200, h, resp));
1755 }), true);
1756 res.getBatchGet(resourceNames: arg_resourceNames, requestMask_includeField : arg_requestMask_includeField).then(unittest.expectAsync(((api.GetPeopleRespons e response) {
1757 checkGetPeopleResponse(response);
1758 })));
1759 });
1760
1761 });
1762
1763
1764 unittest.group("resource-PeopleConnectionsResourceApi", () {
1765 unittest.test("method--list", () {
1766
1767 var mock = new HttpServerMock();
1768 api.PeopleConnectionsResourceApi res = new api.PeopleApi(mock).people.conn ections;
1769 var arg_resourceName = "foo";
1770 var arg_pageToken = "foo";
1771 var arg_pageSize = 42;
1772 var arg_sortOrder = "foo";
1773 var arg_syncToken = "foo";
1774 var arg_requestMask_includeField = "foo";
1775 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1776 var path = (req.url).path;
1777 var pathOffset = 0;
1778 var index;
1779 var subPart;
1780 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1781 pathOffset += 1;
1782 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/"));
1783 pathOffset += 3;
1784 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1785
1786 var query = (req.url).query;
1787 var queryOffset = 0;
1788 var queryMap = {};
1789 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1790 parseBool(n) {
1791 if (n == "true") return true;
1792 if (n == "false") return false;
1793 if (n == null) return null;
1794 throw new core.ArgumentError("Invalid boolean: $n");
1795 }
1796 if (query.length > 0) {
1797 for (var part in query.split("&")) {
1798 var keyvalue = part.split("=");
1799 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1800 }
1801 }
1802 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
1803 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ als(arg_pageSize));
1804 unittest.expect(queryMap["sortOrder"].first, unittest.equals(arg_sortOrd er));
1805 unittest.expect(queryMap["syncToken"].first, unittest.equals(arg_syncTok en));
1806 unittest.expect(queryMap["requestMask.includeField"].first, unittest.equ als(arg_requestMask_includeField));
1807
1808
1809 var h = {
1810 "content-type" : "application/json; charset=utf-8",
1811 };
1812 var resp = convert.JSON.encode(buildListConnectionsResponse());
1813 return new async.Future.value(stringResponse(200, h, resp));
1814 }), true);
1815 res.list(arg_resourceName, pageToken: arg_pageToken, pageSize: arg_pageSiz e, sortOrder: arg_sortOrder, syncToken: arg_syncToken, requestMask_includeField: arg_requestMask_includeField).then(unittest.expectAsync(((api.ListConnectionsRe sponse response) {
1816 checkListConnectionsResponse(response);
1817 })));
1818 });
1819
1820 });
1821
1822
1823 }
1824
OLDNEW
« no previous file with comments | « generated/googleapis/test/partners/v2_test.dart ('k') | generated/googleapis/test/playmoviespartner/v1_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698